-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(storage): use mdbx_txn_reset
to time out transactions
#6850
Conversation
mdbx_txn_reset
to abort timeouted transactions
ab91fef
to
4d76873
Compare
Co-authored-by: Emilia Hane <[email protected]>
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.
nice find
8368314
to
6e87378
Compare
mdbx_txn_reset
to abort timeouted transactionsmdbx_txn_reset
to time out transactions
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.
super clean interface, some test coverage missing
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.
super nice! one typo in a comment (see suggestion)
Co-authored-by: Emilia Hane <[email protected]>
Fixes #6441, #6699
mdbx_txn_reset
instead ofmdbx_txn_abort
for timing out transactionsmdbx_txn_abort
is that it frees the transaction pointer, meaning that MDBX can re-use it for new read-only transactions.mdbx_txn_reset
releases old snapshots of the data too, hence prevents the growth of the freelist (see https://erthink.github.io/libmdbx/usage.html#autotoc_md50).mdbx_txn_reset
, MDBX crashes.TxnManager
mdbx_txn_flags(txn_ptr) & MDBX_TXN_FINISHED == 1
now.txn_execute
method that does locking