limbo: fix a crash in linearization point waiting#11845
Merged
Conversation
The DB state synchronization for a linearizable transaction is trying to wait for the receipt of all potentially confirmed synchro txns from a remote master, and then waits for their confirmation locally. Thus guaranteeing, that if any transaction was committed on the master before this point, then it is now visible on the current replica too. Waiting for the synchro txns confirmation was done in a way that if the limbo isn't empty, then it 100% must contain a synchro txn in it. But it is not always so. Sometimes it might contain a volatile async txn, which isn't written to WAL yet. Or it might even contain dummy entries created by the limbo flush operation (for a snapshot, for a new replica join). About these things the linearization sync must not care and should treat them like if the limbo is empty. Note that there might be more places where txn_limbo_is_empty() seems not exactly 100% safe to use, but for none of them a reproducer could be designed. The other places might actually be safe until proven otherwise. Closes #11807 NO_DOC=bugfix
Collaborator
Author
|
@Serpentian , ping 🥹. |
Serpentian
reviewed
Sep 27, 2025
Contributor
Serpentian
left a comment
There was a problem hiding this comment.
The patch is great, but I'm afraid there're two more places, where the same type of crash may happen, let's either make sure it's not possible there or fix them/create tickets
Serpentian
approved these changes
Sep 29, 2025
Contributor
Serpentian
left a comment
There was a problem hiding this comment.
I don't have any more comments, thank you!
sergepetrenko
approved these changes
Sep 30, 2025
Collaborator
sergepetrenko
left a comment
There was a problem hiding this comment.
Thanks for the fix!
LGTM.
xuniq
approved these changes
Sep 30, 2025
Collaborator
|
Successfully created backport PR for |
This was referenced Oct 1, 2025
Collaborator
|
Successfully created backport PR for |
Collaborator
|
Successfully created backport PR for |
Collaborator
Backport summary
|
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.
The DB state synchronization for a linearizable transaction is trying to wait for the receipt of all potentially confirmed synchro txns from a remote master, and then waits for their confirmation locally. Thus guaranteeing, that if any transaction was committed on the master before this point, then it is now visible on the current replica too.
Waiting for the synchro txns confirmation was done in a way that if the limbo isn't empty, then it 100% must contain a synchro txn in it.
But it is not always so. Sometimes it might contain a volatile async txn, which isn't written to WAL yet. Or it might even contain dummy entries created by the limbo flush operation (for a snapshot, for a new replica join). About these things the linearization sync must not care and should treat them like if the limbo is empty.
Note that there might be more places where txn_limbo_is_empty() seems not exactly 100% safe to use, but for none of them a reproducer could be designed. The other places might actually be safe until proven otherwise.
Closes #11807
NO_DOC=bugfix