-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: implement server-side transaction timeouts #61102
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. I was unable to automatically find someone to ping. If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
@ajwerner this is the issue we discussed in Slack. |
See #5924 for a previous discussion about this feature. I think we landed on only implementing Using that combined with What is the remaining use case? It would have to be a transaction that has lots of statements in it that all execute under the Not that we have to stick to what PostgreSQL does, but just noting that PG also has a cc @awoods187 |
From customer who initiated this issue in response to @rafiss “ I've seen the idle_in_transaction_session_timeout setting. If I understand that correctly it kills connections that hold an idle transaction open past some timeout. Two things that don't seem to align with my original request:
|
Customer who initiated this request had an outage due to a badly written, long-running |
To clarify, is the ask for command that lets you kill a query, or a command that lets you kill a transaction? There already is a command that lets you kill a query. See https://www.cockroachlabs.com/docs/stable/cancel-query.html Also see https://www.cockroachlabs.com/docs/v21.1/manage-long-running-queries If the ask is for a command to kill a transaction, then I would like to hear what additional functionality is needed apart from the |
Thank you Lance! I need a little more help here. The Jira issues you linked all seem to be intended to get at the problem from the other end -- that is, those issues are performance improvements so that transactions don't get stuck. They don't seem related to how we would implement a I would like to understand what we expect a Also, the clarifying info you gave on the earlier request for server-side transaction timeouts helped a lot! I do think a server-side transaction timeout setting sounds like a good idea. |
I'll tack on that |
To summarize the responses above that will help us consolidate use cases (feel free to edit directly): For multi-statement transactions:
@lancel66 Does the user have an obvious threshold for badly written vs legitimate long-running transactions? Was the badly written txn ever idle? Is it OK for the transaction timeout to be applied at a statement boundary (in between two statements in the transaction)? Or does the timeout need to be more precise and cancel an actively running query? For single statement transactions:
|
Is your feature request related to a problem? Please describe.
Even with a statement_timeout setting of 50 milliseconds, there is no cap to how long the transaction can run (and hold locks and increase contention, etc)
Describe the solution you'd like
A transaction_timeout setting which would handle multi-statement transactions which statement_timeout setting cannot address.
Describe alternatives you've considered
Low statement_timeout setting
gz#7680
gz#8786
gz#9005
Epic CRDB-17785
Jira issue: CRDB-3068
The text was updated successfully, but these errors were encountered: