Fix partial distributed commit of uncommitted changes during shard restart race #2169
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.
Changelog entry
Fix partial distributed commit of uncommitted changes during shard restart race.
Changelog category
Additional information
A rare G0 anomaly was detected with Jepsen, which corresponded to a partial commit of accumulated changes when using persistent distributed transactions. Investigation showed that the
Frozen
lock flag was not persisted (this flag is set for write locks when they are validated and outgoing readsets are generated, and used to protect lock changes until transaction decides to commit or abort based on other participant decisions), and there was a window after a given shard restarts and before it fully restores the pipeline dependencies (includingFrozen
flag for locks validated in previous generations). During this time window lock subscription may report lock as unavailable or expired (e.g. when transaction is fully removed from a KQP session, either due to implicit rollback also failing quickly due to shard unavailability, or node restarting and losing all state). This in turn rolled back (previously frozen) lock changes, when they should have been committed instead.Fixes KIKIMR-21088. Ported to 24-1 from #2148.