You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
24-4: Fix follower assertions on attach snapshot races - #15077
Fixed a rare assertion (process crash) when followers attached to leaders with an inconsistent snapshot. Fixes#15042.
Changelog category
Bugfix
Description for reviewers
Followers produced crashes in production periodically complaining about log reordering, with an error message indicating as if they tried to apply a duplicate redo log entry (which shouldn't have been possible). Turns out snapshots created within read-only transactions that used QueueScan (e.g. ReadTable and ScanQuery) persisted an incorrect Serial field (a monotonically increasing change number) that was equal to the next transaction. When follower attached at just the right time, it could bootstrap from such a snapshot, and discover the next commit has the same Serial, indicating a duplicate or reordered change.
Thankfully this didn't affect leaders, since they apply pre-snapshot and post-snapshot redo log entries together, and only use snapshot serial as a hint of previously compacted changes. So even though snapshot technically had an inconsistent value it was self-healing and couldn't produce any externally visible inconsistencies.
⚪ 2025-02-26 14:23:21 UTC Pre-commit check for b9dbf12 has started.
⚪ 2025-02-26 14:26:07 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2025-02-26 15:06:43 UTC Build successful.
⚪ 2025-02-26 15:06:59 UTC Tests are running...
🔴 2025-02-26 16:36:55 UTC Some tests failed, follow the links below.
⚪ 2025-02-26 14:23:43 UTC Pre-commit check for b9dbf12 has started.
⚪ 2025-02-26 14:26:24 UTC Build linux-x86_64-release-asan is running...
🟢 2025-02-26 14:51:03 UTC Build successful.
⚪ 2025-02-26 14:51:21 UTC Tests are running...
🔴 2025-02-26 17:07:16 UTC Some tests failed, follow the links below.
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
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
Fixed a rare assertion (process crash) when followers attached to leaders with an inconsistent snapshot. Fixes #15042.
Changelog category
Description for reviewers
Followers produced crashes in production periodically complaining about log reordering, with an error message indicating as if they tried to apply a duplicate redo log entry (which shouldn't have been possible). Turns out snapshots created within read-only transactions that used
QueueScan(e.g. ReadTable and ScanQuery) persisted an incorrectSerialfield (a monotonically increasing change number) that was equal to the next transaction. When follower attached at just the right time, it could bootstrap from such a snapshot, and discover the next commit has the sameSerial, indicating a duplicate or reordered change.Thankfully this didn't affect leaders, since they apply pre-snapshot and post-snapshot redo log entries together, and only use snapshot serial as a hint of previously compacted changes. So even though snapshot technically had an inconsistent value it was self-healing and couldn't produce any externally visible inconsistencies.