-
Notifications
You must be signed in to change notification settings - Fork 57
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
backoff in the transaction loop is problematic #188
Comments
Thanks for your comments. As noted in the docstring, there are arguments to limit the number of retries and their (maximum) duration, which could be used to mitigate the "cost of contention" to which you refer. What would you suggest as an alternative? |
It should not perform any exponential backoff. It should retry right away, to minimize the amount of time that the client is asleep while holding these locks in the database. |
Specifying |
The exponential backoff potentially could make more sense if the transaction was fully rolled back, and then a new one was started. |
In cockroach, when using the
SAVEPOINT cockroach_restart
technique to recover from serializable restarts, the transaction's locks are held across restarts. This enables liveness among contended transactions. In the driver today, there's exponential backoff in those restarts. That means that locks will be held for a long period of inactivity, exacerbating the cost of contention potentially greatly.See
sqlalchemy-cockroachdb/sqlalchemy_cockroachdb/transaction.py
Lines 77 to 90 in 19e66cc
The text was updated successfully, but these errors were encountered: