Repository navigation
bft: hold the view while the view changer writes - #745
Merged
Merged
Conversation
HagarMeir
reviewed
Nov 2, 2026
| return &holdTestProposer{}, COMMITTED | ||
| } | ||
|
|
||
| func TestAbortViewAndHoldBlocksViewChangesUntilReleased(t *testing.T) { |
Contributor
There was a problem hiding this comment.
Could this test go in controller_abort_view_test.go? It's the same package and topic, and that file already has newAbortTestView, abortTestBatcher and abortTestLeaderMonitor. holdTestProposer looks like it could be a View from newAbortTestView.
(Written by Claude Code.)
Comment on lines
+475
to
+477
| // A view change record is not a truncation point in this change: the | ||
| // proposal in flight, if there is one, travels in the view data message | ||
| // and must stay recoverable. |
Contributor
There was a problem hiding this comment.
Nit: "is not a truncation point in this change" (here and at L1258) will read oddly once this is merged, because "this change" won't mean anything in the code. Maybe "is not a truncation point" plus the reason?
(Written by Claude Code.)
The view changer saved a ViewChange or NewView record after AbortView returned, but the controller could restart the view through the sync path before the record was written. A commit could then land after the record and leave a WAL sequence that recovery rejects. Add AbortViewAndHold and ReleaseViewWrite, and let the view changer hold viewTransitionLock from the abort until its record is saved. changeView also takes the lock. A stale view change or new view is rejected instead of writing over a newer view. AbortViewAndHold keeps the cancel channel that AbortView uses, so stopping the view changer still cannot hang on a reconfiguration lock. Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
pfi79
force-pushed
the
735-4c-view-changer-hold
branch
from
November 2, 2026 09:17
7440d2e to
726c82a
Compare
Contributor
Author
|
fixed |
HagarMeir
approved these changes
Nov 2, 2026
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 view changer saved a ViewChange or NewView record after AbortView returned, but the controller could restart the view through the sync path before the record was written. A commit could then land after the record and leave a WAL sequence that recovery rejects.
Add AbortViewAndHold and ReleaseViewWrite, and let the view changer hold viewTransitionLock from the abort until its record is saved. changeView also takes the lock. A stale view change or new view is rejected instead of writing over a newer view.
AbortViewAndHold keeps the cancel channel that AbortView uses, so stopping the view changer still cannot hang on a reconfiguration lock.
#736