forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix initialization of next_shared_object_versions (MystenLabs#7044)
Previously, we attempted to initialize `next_shared_object_versions` the first time we sequence a cert that touches a given object. Unfortunately, this will not work if a transaction touching that object has already been executed via checkpoint sync. See the referenced bug below for details. To fix this, we now initializate `next_shared_object_versions` for a given object _before_ we set the shared locks for that object regardless of whether we are setting the locks in the consensus task or from checkpoint sync. This ensures that, if the object already existed (i.e. was created in a prior epoch) we are guaranteed to read the latest version of the object from the previous checkpoint. However, because we are now initializing `next_shared_object_versions` from multiple tasks, we need to account for races. Optimistic transactions are used to handle races. When there is a race, one task will succeed in initializing `next_shared_object_versions`, and then other tasks will have to retry, will notice that `next_shared_object_versions` has been initialized already, and will not attempt to write to it again. Also expose SetSnapshot function of rocksdb transactions. Fixes MystenLabs#5754
- Loading branch information
1 parent
e075c9f
commit f77f58f
Showing
8 changed files
with
416 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -551,4 +551,6 @@ TypedStoreError: | |
CrossDBBatch: UNIT | ||
4: | ||
MetricsReporting: UNIT | ||
5: | ||
TransactionWriteConflict: UNIT | ||
|
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
Oops, something went wrong.