-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Recovery invariant related to old generation tlogs and remote tlogs #12576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
spraza
wants to merge
2
commits into
apple:main
Choose a base branch
from
spraza:recovery-invariant-iter2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have
ASSERT_WE_THINKbelow, so these lines are not needed.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jzhou77 Actually this trace was not there originally, I was experimenting by adding logging since I found failures (that's why turned this PR to draft).
Have a look at: https://github.com/apple/foundationdb/pull/12577/files. This is minimal code needed to reproduce the issue. Tests fail pretty quickly with it.
Example failure:
fdbserver -r simulation -f /root/src/foundationdb/tests/fast/ConfigIncrement.toml --buggify on --seed 2729610066.I can see that at accepting_commits, all logs is false but old tlogs is 0. I think that's because this is the first recovery of the cluster (new cluster). But in this case, we set RecoveryCompleteWrittenToCoreState to true while we are not at fully_recovered. Sev40 below. I spot checked more failures and in all cases so far, it's the first recovery of the cluster that seems to break the invariant.
Sev40:
<Event Severity="40" ErrorKind="Unset" Time="10.031027" DateTime="2025-11-22T06:19:17Z" Type="FooRecoveryInvariant1" Machine="[abcd::2:0:1:0]:1" ID="0000000000000000" AllLogs="0" OldTLogSize="0" NewTLogSize="2" FinalUpdate="0" WillBeFullyRecovered="0" CurrRecoveryState="6" RecoveryCompleteWrittenToCoreStateWillBeSetToTrue="1" ThreadID="9766125937575351112" Backtrace="/usr/local/bin/llvm-addr2line -e /root/cnd_build_output/bin/fdbserver -p -C -f -i 0x556d7ef 0x556dae9 0x5567cd4 0x2227f94 0x2227df7 0x2226f90 0x2269ed8 0x226afc9 0x226ec83 0x248ea18 0x248e61e 0x2490313 0x248aeb8 0x248b243 0x248a631 0x248a933 0x1ed45c8 0x1ed423b 0x1ef6ac8 0x2489fc8 0x2477158 0x2476bb2 0x246f528 0x246f321 0x246bfde 0x246c858 0x246c622 0x246fe68 0x246f6d2 0x2470a78 0x2470140 0x247bd48 0x247bbba 0x53141c4 0x5313abc 0x1d84af8 0x541b8b7 0x541b3e0 0x3204d2a 0x7fad024745d0" LogGroup="default" Roles="CC,CD,CP,GP,SS,TL" />There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. For the first generation, there is no previous tlogs, i.e.,
newState.oldTLogData.empty()is alwaystrue. However, hereallLogsis not necessarily true. So the assertion should take the generation into account, i.e., with an additional condition that this is not the first generation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried skipping first generation (ClusterRecoveryData->lastEpochEnd is 0). The invariant still breaks. I looked at one failure and can confirm there were multiple recoveries. Cluster is HA (I see LogRouters being recruited).
Will debug more.