Conversation
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.
Potential correctness issue in conflict check
xuerong raised a potential correctness issue on Discord related to the conflict check logic. This may occur in the following scenario.
#373
The question concerns the
validate_write_conflictsmethod intransaction.rs:Inside this method,
get_earliest_memtable_seq()is called, followed bycheck_keys_conflict(). However, there is no synchronized projection between these two operations.Is it possible that another thread updates
flushed_history(for example viaflush_immutable_to_sst()) between these two calls? If that happens,check_keys_conflict()might run with a modifiedflushed_historyinstead of the one corresponding to the earlier state, which could potentially break transaction guarantees.Example scenario
get_earliest_memtable_seq()flush_immutable_to_sst()check_keys_conflict()In this case,
check_keys_conflict()would execute afterflushed_historyhas been updated, meaning it may not be validating against the same state that existed whenget_earliest_memtable_seq()was called.This could result in the original
flushed_historybeing replaced before the conflict check completes, potentially leading to an incorrect validation and violating transaction guarantees.