Skip to content

[Store] Publish SSD bucket metadata atomically after fsync - #5775

Closed
MaskVulcan wants to merge 1 commit into
kvcache-ai:mainfrom
MaskVulcan:ssd/bucket-metadata-durability
Closed

MaskVulcan wants to merge 1 commit into
kvcache-ai:mainfrom
MaskVulcan:ssd/bucket-metadata-durability

Conversation

@MaskVulcan

@MaskVulcan MaskVulcan commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Write bucket metadata to a temporary file, fsync it, rename it into place,
and fsync the directory before acknowledging the bucket. This prevents a
partially written metadata file from being treated as a committed bucket
after restart. Failure cleanup removes both the data and metadata files.

This extracts the local persistence prerequisite for the SSD recovery work
in RFC #5768.

Suggested Merge Priority

  • P2 — Normal

Module

  • Mooncake Store

Type of Change

  • Bug fix

How Has This Been Tested?

The Release storage_backend_test CTest target passed. New failure-injection
coverage checks write, file-sync, rename and directory-sync failures, retry,
restart recovery, and publication before the completion callback.
Scoped pre-commit passed.

Checklist

AI Assistance Disclosure

Codex assisted with extracting and validating the change.

Signed-off-by: MaskVulcan <9528071+MaskVulcan@users.noreply.github.com>
@MaskVulcan

Copy link
Copy Markdown
Collaborator Author

Consolidated into Draft PR #5791 (Part 5 of the 5-PR SSD Offload series tracked in RFC #5768).

@MaskVulcan MaskVulcan closed this Nov 24, 2026
MaskVulcan added a commit to MaskVulcan/Mooncake that referenced this pull request Nov 25, 2026
…urable retirement

Implement the generation-scoped SSD recovery and HA retirement stage of
RFC kvcache-ai#5768 on top of the compatible wire/codec foundation and prerequisites
kvcache-ai#5774 and kvcache-ai#5775:
- Mint per-write generations on PutStart/UpsertStart and enforce matching
  captured grants on PutEnd/PutRevoke and batch/session variants.
- Key SSD offload records with length-delimited generation storage keys,
  fence offload and promotion completion/failure notifications by object
  generation and task_id (allowing holder release of unallocated prefetch
  tasks), and prevent stale scans from resurrecting deleted/removed objects.
- Wait for ordered OpLog durability and callback finalization before
  retiring overwritten/removed allocations in HA mode, bounded by
  oplog_durable_wait_timeout_ms.
- Add docs/source/design/store/ssd-generations.md, unit/integration tests,
  and adapt existing tests to forward captured primary write grants.

Signed-off-by: MaskVulcan <9528071+MaskVulcan@users.noreply.github.com>
MaskVulcan added a commit to MaskVulcan/Mooncake that referenced this pull request Nov 25, 2026
…urable retirement

Implement the generation-scoped SSD recovery and HA retirement stage of
RFC kvcache-ai#5768 on top of the compatible wire/codec foundation and prerequisites
kvcache-ai#5774 and kvcache-ai#5775:
- Mint per-write generations on PutStart/UpsertStart and enforce matching
  captured grants on PutEnd/PutRevoke and batch/session variants.
- Key SSD offload records with length-delimited generation storage keys,
  fence offload and promotion completion/failure notifications by object
  generation and task_id (allowing holder release of unallocated prefetch
  tasks), and prevent stale scans from resurrecting deleted/removed objects.
- Wait for ordered OpLog durability and callback finalization before
  retiring overwritten/removed allocations in HA mode, bounded by
  oplog_durable_wait_timeout_ms.
- Add docs/source/design/store/ssd-generations.md, unit/integration tests,
  and adapt existing tests to forward captured primary write grants.

Signed-off-by: MaskVulcan <9528071+MaskVulcan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci size/M 100-1000 changed lines (additions + deletions) Store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant