Skip to content

[Cluster] Retire outdated checkpoints with shared indexes - #2144

Merged
Vasileios Zois (vazois) merged 4 commits into
microsoft:mainfrom
ezhang3333:ezhang3333/fix-checkpoint-cleanup-2142
Sep 21, 2026
Merged

Vasileios Zois (vazois) merged 4 commits into
microsoft:mainfrom
ezhang3333:ezhang3333/fix-checkpoint-cleanup-2142

Conversation

@ezhang3333

@ezhang3333 ezhang3333 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Checkpoint cleanup could leave an old checkpoint listed after deleting its log. Later cleanup then reads the missing log and skips truncation.

Root Cause

A newer checkpoint can reuse an older checkpoint's index. Cleanup stopped when it found that shared index, even though it had already deleted the older log.

Fix

Keep the shared index and retire the old checkpoint entry. A regression test covers three successive checkpoints.

Testing

  • Five focused cluster replication tests passed on .NET 10.
  • Formatting passed for both changed files.

Notes

Copilot AI balanced review requested due to automatic review settings September 16, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix matches the reported failure and is covered by an appropriate regression test.

Pull request overview

Fixes cluster checkpoint cleanup when newer checkpoints share an older index.

Changes:

  • Retires obsolete log entries while preserving shared indexes.
  • Adds regression coverage for repeated checkpoint cleanup.
File summaries
File Description
libs/cluster/Server/Replication/CheckpointStore.cs Preserves shared index tokens during cleanup.
test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs Verifies one readable log and shared-index retention.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Exercise the deletion loop while a replica pins a checkpoint entry, so the
shared-index retirement path is verified against reader suspension as well.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Ethan Zhang <[email protected]>
@vazois
Vasileios Zois (vazois) merged commit c323bbf into microsoft:main Sep 21, 2026
169 checks passed
x@01 (x-at-01) added a commit to webc-fork/garnet that referenced this pull request Oct 4, 2026
…soft#2156), path composition normalize (microsoft#2147), refuse serve w/o HLog checkpoint (microsoft#2153), retire outdated checkpoints (microsoft#2144), checkpoint serialize race (microsoft#2136), RecoveryRollback flaky (microsoft#2137)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeleteOutdatedCheckpoints retains a deleted hlog token, causing metadata parse failures on every later checkpoint

3 participants