-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iterator: Always add key to txn.reads (#1328)
The SSI guarantees provided by badger are respected when multiple concurrent transactions try to update the same key at once using the txn.Get and txn.Set API ``` // txn.Get // if not found; txn.Set and Commit ``` but the same guarantees fail when an `iterator` is used instead of the `txn.Get` API ``` // itr.Seek(key) // if not itr.Valid(); txn.Set and Commit ``` If the code above is executed via multiple concurrent transactions, we might overwrite the first update. The test `TestConflict` added in this PR fails on master but works fine on this PR. Fixes #1289
- Loading branch information
Ibrahim Jarif
committed
Oct 2, 2020
1 parent
eea455a
commit 90daf43
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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