Conversation
Contributor
📊 Benchmark Resultsget-sync.bench.tsgetSync() > random keys - small key size (100 records)
getSync() > sequential keys - small key size (100 records)
ranges.bench.tsgetRange() > small range (100 records, 50 range)
realistic-load.bench.tsRealistic write load with workers > write variable records with transaction log
transaction-log.bench.tsTransaction log > read 100 iterators while write log with 100 byte records
Transaction log > read one entry from random position from log with 1000 100 byte records
worker-put-sync.bench.tsputSync() > random keys - small key size (100 records, 10 workers)
worker-transaction-log.bench.tsTransaction log with workers > write log with 100 byte records
Results from commit 6f046e7 |
kriszyp
approved these changes
Mar 19, 2026
Member
kriszyp
left a comment
There was a problem hiding this comment.
This looks good to me, I think this is a solid way to handle this.
(I think I am still a little skeptical that throwing an error is the best way to communicate that something should be retried, but its fine, this works).
Good job getting this together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
db.transaction()ordb.transactionSync()and a transaction log, if the transaction fails due to aERR_BUSYerror, the log and the data in RocksDB will be inconsistent. The transaction should be retried.Currently,
db.transaction()will automatically abort the transaction if the commit fails leaving no opportunity for the transaction to be retried.This PR adds a retry mechanism that will re-run the transaction. If the commit fails, it will retry up to
maxRetries(default 3). If it still can't commit, or theretryOnBusyoption isfalse, then it throws theERR_TRANSACTION_ABANDONEDerror.The transaction callback function now accepts a 2nd argument:
attempt. This value starts at1and goes tomaxRetries. Users will need to useattempts === 1to ensureaddEntry()is only called once.