-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Throttled transactions return MySQL error code 1041 ER_OUT_OF_RESOURCES #12949
Throttled transactions return MySQL error code 1041 ER_OUT_OF_RESOURCES #12949
Conversation
This error code seems better suited to represent the fact that transactions are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS. Signed-off-by: Eduardo J. Ortega U <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
@shlomi-noach do you have opinions on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ER_OUT_OF_RESOURCES
means "out of memory" in MySQL's docs. So this, too, is perhaps not the most descriptive error?
It doesn't seem any existing MySQL error is a great fit, so I think we're stuck with "the best we can find" or proposing a new error code to the upstream project, but this new code wouldn't exist on current versions. Maybe the lack of a clear winner means it should be configurable?
ER_UNKNOWN_ERROR might work, but it removes all context and sounds like something unexpected happened. Another is ER_QUERY_INTERRUPTED - it usually means Some more alternatives I found that I feel are less-ideal:
Given these suboptimal options I feel "OUT_OF_RESOURCES" gives the user the best picture of what's going on, although the docs will make it sound like it's memory consumption related 🤔 |
Go wild with |
Oh! After reviewing the 8.x+ error codes I found a decent fit: ER_RESOURCE_GROUP_BUSY. Of course, we're not really a "resource group" but we ARE measuring "resources" and want to tell the client we are "busy". The concepts have some overlap 🤔
This doesn't really help 5.x though. Curious what thoughts you had @ejortegau / @shlomi-noach? |
Not sure if it at all matters to users of |
That's a good point. I guess the question is how would a 5.7 I'll find some time to investigate this scenario 👍 |
I would go with 1041 for now - seems the least bad one IMHO. But I am happy to change it if you think it's better - the nature of the change as you can see from the PR is quite simple. |
@ejortegau 1041 sounds good to me 👍 |
…ES (vitessio#12949) This error code seems better suited to represent the fact that transactions are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS. Signed-off-by: Eduardo J. Ortega U <[email protected]>
…ES (vitessio#12949) (#81) This error code seems better suited to represent the fact that transactions are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS. Signed-off-by: Eduardo J. Ortega U <[email protected]> Co-authored-by: Eduardo J. Ortega U <[email protected]>
…ES (vitessio#12949) This error code seems better suited to represent the fact that transactions are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS. Signed-off-by: Eduardo J. Ortega U <[email protected]>
* Skip recalculating the rate in MaxReplicationLagModule when it can't be done (vitessio#12620) * Skip recalculating the rate in MaxReplicationLagModule when it can't be done This defends against lag records with nil stats which can lead to segfaults. See vitessio#12619 Signed-off-by: Eduardo J. Ortega U <[email protected]> * Address PR comments. Signed-off-by: Eduardo J. Ortega U <[email protected]> * Make linter happy Signed-off-by: Eduardo J. Ortega U <[email protected]> --------- Signed-off-by: Eduardo J. Ortega U <[email protected]> * Throttled transactions return MySQL error code 1041 ER_OUT_OF_RESOURCES (vitessio#12949) This error code seems better suited to represent the fact that transactions are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS. Signed-off-by: Eduardo J. Ortega U <[email protected]> * MaxReplicationLagModule.recalculateRate no longer fills the log (vitessio#14875) Signed-off-by: Eduardo J. Ortega U <[email protected]> --------- Signed-off-by: Eduardo J. Ortega U <[email protected]> Co-authored-by: Eduardo J. Ortega U <[email protected]>
Description
This PR causes transactions throttled by the Transaction Throttler to return MySQL error code 1041 ER_OUT_OF_RESOURCES. This error code seems better suited to represent the fact that transactions
are being throttled by the server due to some form of resource contention than the current code 1203 ER_TOO_MANY_USER_CONNECTIONS.
Related Issue(s)
#12958
Checklist
Deployment Notes
N/A