You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
claude[bot] round-5 verdict was 'Ready to merge pending design doc
update'. Two non-code items:
1) engine.go:2001 TODO sentinel — the round-5 PR comment claimed a
'sentinel comment in engine.applySnapshot' would land, but no
such comment was added. Round-6 adds it directly above the
openAndRestoreFSMSnapshot call so a future B3 / follow-up
implementor can find the planned SetDurableAppliedIndex hook
site without re-discovering the rationale. Cites the design doc
Non-Goals scope-out and PR #915 round-4/5 codex P2.
2) docs/design/2026_06_02_idempotent_snapshot_restore.md — three
stale references to AppliedIndexReporter / factory-method
pattern, superseded by PR #915 round-5 (kvFSM directly
satisfies raftengine.AppliedIndexReader via LastAppliedIndex).
The stale pseudocode would mislead the B3 implementor into
adding a reporter shim that was already superseded. Updates:
- §3 'kvFSM exposes its store' block rewritten to show direct
interface satisfaction + the compile-time guard.
- §4 fsmAlreadyAtIndex pseudocode rewritten to use direct
type-assert against raftengine.AppliedIndexReader.
- Implementation Plan B2 row updated to reflect the actual
kvFSM.LastAppliedIndex() shape + the round-5 monotonic
applyMu.Lock() RMW guard on SetDurableAppliedIndex.
- §8 compatibility list: AppliedIndexReporter removed; replaced
by AppliedIndexWriter (the actually-shipped interface) plus a
retrospective sentence explaining the round-5 supersession.
Three retrospective mentions of AppliedIndexReporter remain (as
'why this is NOT what we use') so future readers understand the
design history without re-deriving it.
No code semantics change in round-6. Doc + comment-only.
Tests: go vet + golangci-lint clean across kv/, store/,
internal/raftengine/etcd/.
Refs PR #915 round-5 claude[bot] verdict ('Ready to merge pending
design doc update').
-`ApplyIndexAware` is **already** in `main`; this design only adds
815
835
consumers.
816
836
- The new opt-in interfaces (`AppliedIndexReader`,
817
-
`AppliedIndexReporter`, `SnapshotHeaderApplier`) are additive.
837
+
`AppliedIndexWriter`, `SnapshotHeaderApplier`) are additive.
818
838
FSMs that don't implement them fall back to the current behaviour.
839
+
(Round-1 / round-2 of this doc mentioned an `AppliedIndexReporter`
840
+
factory-method shim; PR #915 round-5 superseded it by having
841
+
`kvFSM` satisfy `AppliedIndexReader` directly via its
842
+
`LastAppliedIndex` method.)
819
843
-`metaAppliedIndexBytes` is new. Older fsm.db files don't have it.
820
844
The `present=false` branch makes the first restart after upgrade
821
845
fall back to full restore, populating the meta key from the next
@@ -863,7 +887,7 @@ restoreSnapshotState skipped (FSM at index %d, snapshot at %d, ceiling=%d, cutov
863
887
| Branch | Content | Behaviour change |
864
888
|---|---|---|
865
889
|**B1** (this PR) | Design doc | None |
866
-
|**B2**|`ApplyMutationsRaftAt` / `DeletePrefixAtRaftAt` overloads + meta-key bundling in both leaves + `pebbleStore.LastAppliedIndex()` (under `dbMu.RLock()`) + `pebbleStore.SetDurableAppliedIndex()` (under `dbMu.RLock()`, **`pebble.Sync` unconditionally**) + `kvFSM.AppliedIndexReader()`accessor + `kvFSM.SetDurableAppliedIndex` forwarding + thread `f.pendingApplyIdx` into the data-Apply leaves + BOTH `persistCreatedSnapshot` (`engine.go:2679`) AND `e.persistLocalSnapshotPayload` (`engine.go:4032`, the SnapshotCount-triggered hot path) call `SetDurableAppliedIndex` BEFORE the corresponding `persist.SaveSnap`| Meta key starts being written on every data Apply AND at every snapshot persist (both config-snapshot and steady-state local-snapshot paths). Skip is still disabled. Soak in production for one release. |
890
+
|**B2**|`ApplyMutationsRaftAt` / `DeletePrefixAtRaftAt` overloads + meta-key bundling in both leaves + `pebbleStore.LastAppliedIndex()` (under `dbMu.RLock()`) + `pebbleStore.SetDurableAppliedIndex()` (under `dbMu.RLock()` + `applyMu.Lock()` RMW monotonic guard, **`pebble.Sync` unconditionally**) + `kvFSM.LastAppliedIndex()`directly satisfies `raftengine.AppliedIndexReader` (compile-time guard in `kv/fsm_applied_index_iface_check.go`) + `kvFSM.SetDurableAppliedIndex` forwarding + thread `f.pendingApplyIdx` into the data-Apply leaves + BOTH `persistCreatedSnapshot` (`engine.go:2679`) AND `e.persistLocalSnapshotPayload` (`engine.go:4032`, the SnapshotCount-triggered hot path) call `SetDurableAppliedIndex` BEFORE the corresponding `persist.SaveSnap`| Meta key starts being written on every data Apply AND at every snapshot persist (both config-snapshot and steady-state local-snapshot paths). Skip is still disabled. Soak in production for one release. |
0 commit comments