Skip to content

fix(cache): preserve disk placement identity across restarts (STO-36) - #626

Merged
ketor merged 4 commits into
dingodb:mainfrom
ketor:lr/sto36-disk-ring-identity-d75063a3
Nov 29, 2026
Merged

ketor merged 4 commits into
dingodb:mainfrom
ketor:lr/sto36-disk-ring-identity-d75063a3

Conversation

@ketor

@ketor ketor commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

STO-36 only, replayed onto observed current main 2b82c79e4ea4631e98c8844ade06cc7e6483c99f.

Canonicalize intra-node disk identity and preserve placement history so semantically identical --dir spellings, including symlink aliases and trailing slashes, cannot move keys to different disks or resurrect removed/overwritten values when the original spelling returns.

  • Canonical disk ID matching and duplicate-alias rejection, combined with durable per-disk identity/history and cleanup-publication before healthy service.
  • Bounded, checksummed epoch/instance records with sync-before-rename and directory sync. Running epochs are retained.
  • Strict-majority identity/history checks include valid empty disks. Foreign-only histories do not appoint node identity; known missing, corrupt, duplicate, unsupported, or mixed-history members cannot be waived by a peer majority.
  • Conservative cache loss for ambiguous history, rather than stale-data resurrection; genuinely unseen fresh empty member joins preserve existing data.
  • Dirty/kill-9 and incomplete-publication handling remains fail closed. Default is DFKV_DISK_RING_CHANGE=pass; only explicit reset is otherwise allowed, with no skip/safety-off or default experimental migration.
  • Offline slab/LSE migration retains the held source disk identity across pathname replacement and does not permit foreign identity injection.

The change has 18 paths confined to storage/cache sources, cache tests, and related deployment/metrics docs. No transport, MDS-authentication, shared config parser, external-engine, fused/pending/default-enablement, or release change is included.

Exact candidate

  • Raw head: 1fd75ba4fa5f4424ccdafc03b3e2761fe610eeff
  • Tree: 4b90a149b1725c05927a54923b77915c1cb0c974
  • Immediate parent: 764e8fa852725af9507161cadbe9ff35a6f2689f
  • Replay base/current-main ancestor: 2b82c79e4ea4631e98c8844ade06cc7e6483c99f
  • Replay base tree: c4d18e7ffc27489e98c2a88b723950e673775241

All three commits retain 1:1 range-diff equivalence with the accepted candidate. The 18-file binary patch remains SHA-256 6b2cc70eada4048f02d4908a5192e8ce7a02331c86f7d3cea8d84486df9e0d69; owned storage/test/docs blobs remain byte-identical to the prior approved implementation. Current main's additional replay-trace Python/tests/docs changes are outside this patch.

The raw head is not asserted to be the eventual merge-queue commit.

Fresh focused verification

  • Disk ring identity: 23/23 PASS
  • Disk cache group: 50/50 PASS
  • Slab migration: 15/15 PASS
  • Forced disk-failure membership: 2/2 PASS
  • Failed RAM-tier put rejection: PASS
  • Shared library and server link: successful; ldd -r reports no unresolved symbols and SONAME remains libdfkv.so.2

A disposable unfixed baseline reproduced DirectoryAliasesDoNotResurrectARemovedValue: remove-through-alias misses, then returning to the original spelling exposes the removed value. The baseline production cache sources are identical across the replay-only 235d8676…→2b82c79e… Python/docs update; only the temporary test fixture was added. The candidate passes the same case.

Earlier 8779/a253 full and b590/235 source/CI evidence is preserved separately and is not substituted for this head's acceptance. Final independent source/evidence review remains pending after this head's full gate.

Remaining gates

Fresh public CI at https://github.com/dingodb/DingoCache/actions/runs/46201390984 has completed 13/13 jobs successfully on exact head 1fd75ba4fa5f4424ccdafc03b3e2761fe610eeff.

The maintained full CTest+JUnit run is pending its ordered physical execution window under a unique execution identity. Its discovery and raw-vs-adjudicated outcomes will be computed from its own case results, not copied from older runs.

PR remains draft. No readiness, merge queue, deployment, or broader M-series completion is claimed.

@ketor
ketor force-pushed the lr/sto36-disk-ring-identity-d75063a3 branch 3 times, most recently from 8779b7e to b590a9f Compare November 28, 2026 22:43
- Canonicalize directory identities and persist per-disk node, membership, weight, and epoch history.
- Require coherent majority identity and complete member continuity before activation; reset unprovable histories fail-closed.
- Durable cleanup precedes publication; malformed records fail validation, and fresh unseen empty members retain ordinary data.
- Cover aliases, upgrade/downgrade, foreign authority, lost record evidence, mixed activations, and malformed codec inputs.
- Return the original storage I/O error for failed single-disk writes while keeping publication failures fail-closed.
- Validate and carry .dfkv-ring metadata through offline slab-to-LSE migration without promoting temporary writes or accepting foreign files.
- Reproduce the original single-disk and migration CI failures and retain both native C++ and exact plugin controls.
- Parse ring identity from the held source descriptor and retain it through publication.
- Anchor expected inventory and ring-presence checks to root_fd rather than replaceable pathnames.
- Prove a valid replacement root cannot inject a foreign identity after SlabSnapshot::Open.
- Run full migration, identity, compatibility and linked-artifact controls.
@ketor
ketor force-pushed the lr/sto36-disk-ring-identity-d75063a3 branch from b590a9f to 1fd75ba Compare November 28, 2026 23:23
- Reject a present ring record when its slab epoch differs from the snapshot state epoch
- Add a migration regression that fails on the preceding implementation and leaves no destination on rejection
@ketor
ketor marked this pull request as ready for review November 29, 2026 06:45
@ketor
ketor added this pull request to the merge queue Nov 29, 2026
Merged via the queue into dingodb:main with commit 7f9426a Nov 29, 2026
13 checks passed
@ketor

ketor commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Validation on exact head 05bb822a49c377fd92bbb94b844241f9da99a719 (base 2b82c79e4ea4631e98c8844ade06cc7e6483c99f):\n- Independent final integration review: GO, no must-fix findings over all 18 changed paths.\n- Maintained full: 2044 PASS / 99 SKIP / 0 FAIL (discovery 2149, executed 2143), with all 45 required CTest+JUnit proofs. Raw 2038/105/0 and six execution-backed name-only corrections are preserved separately; no skipped case is promoted to a pass.\n- Public CI https://github.com/dingodb/DingoCache/actions/runs/46204961577: 13/13 successful on the exact head.\n- The present-record/slab-epoch conflict regression fails the pre-fix controller and passes the candidate. Legacy record-absent migration remains supported, with no bypass flag or default experimental migration.\n\nActual queue merge: 7f9426ada40f7c721953a97e9bea89b56b8e0476; resulting tree 498dfe3796d7df6ed0419361cb5ef0c0274c8b7e equals the reviewed candidate tree. Scope is disk placement identity and defensive migration, not a production rollout or performance claim.

@ketor
ketor deleted the lr/sto36-disk-ring-identity-d75063a3 branch November 29, 2026 06:56
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.

1 participant