Fix flaky ClusterMigrateRangeIndexCheckpointThenRecover: flush AOF before graceful restart#1959
Open
tiagonapoli wants to merge 3 commits into
Open
Fix flaky ClusterMigrateRangeIndexCheckpointThenRecover: flush AOF before graceful restart#1959tiagonapoli wants to merge 3 commits into
tiagonapoli wants to merge 3 commits into
Conversation
The cluster test ClusterMigrateRangeIndexCheckpointThenRecover intermittently failed because a post-checkpoint RI.SET was acked but not durably committed to the AOF before the node was gracefully restarted. Graceful Dispose does not flush the AOF, so the write was lost on recovery. Add an opt-in ensureAofFlush parameter to ClusterTestContext.ShutdownNode / RestartNode that issues a synchronous CommitAOFAsync before disposing the node, and use it from the RangeIndex migrate test's RestartNode helper so all its restarts flush pending AOF commits first. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a8557ca8-3a4c-487c-bbf1-dd45e03caca5
tiagonapoli
marked this pull request as ready for review
July 21, 2026 18:04
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent failure in the cluster RangeIndex migration recovery test by ensuring pending AOF work is durably committed before a “graceful” node restart during the test.
Changes:
- Added an opt-in
ensureAofFlushparameter toClusterTestContext.ShutdownNode(...)andRestartNode(...)to force an AOF commit prior to disposal. - Updated the RangeIndex migrate test helper to restart nodes with
ensureAofFlush: true.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/cluster/Garnet.test.cluster/ClusterTestContext.cs | Adds optional AOF commit before shutdown/restart to make test restarts durable. |
| test/cluster/Garnet.test.cluster.migrate.rangeindex/ClusterRangeIndexMigrateTests.cs | Uses the new option to flush AOF before restarting the target node in the flaky test. |
vazois
self-requested a review
July 21, 2026 18:22
vazois
approved these changes
Jul 21, 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.
Problem
ClusterMigrateRangeIndexCheckpointThenRecover (in
Garnet.test.cluster.migrate.rangeindex) intermittently fails with "post-checkpoint RI.SET should survive recovery".Root cause
The test does a post-checkpoint
RI.SETand then immediately restarts the target node. That write is acknowledged to the client but, atCommitFrequencyMs=0(async auto-commit), is not yet durably flushed to the AOF. A graceful shutdown (GarnetServer.Dispose→StoreWrapper.Dispose) cancels the background committer and does not flush the AOF, so the acked-but-uncommitted tail is lost on recovery — the test then can't find thepost_ckptvalue.This mirrors the durability contract every other AOF-recovery test relies on (they all issue
COMMITAOF/commitWait/CommitAOFAsyncbefore restart); this test omitted it.Fix (test-only)
Add an opt-in
ensureAofFlushparameter toClusterTestContext.ShutdownNode/RestartNodethat issues a synchronousStore.CommitAOFAsyncbefore disposing the node. The RangeIndex migrate test'sRestartNodehelper passesensureAofFlush: trueso all its restarts flush pending AOF commits first.Validation