Repository navigation
Conversation
setLeaderMetric already counts leader changes inline; the helper was only called from TestRaftMetricsExportLeaderChangesAndProposalFailures, which now drives the live path with two different leaders for one group. Dropping the Inc in setLeaderMetric fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
No production caller decodes only the home slot of a chunk route key; ChunkRoutePartsFromKey is the live decoder. Its test now also covers the chunk prefix rejection the deleted test checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
…fixesForQueue Neither has a production caller. setQueueAttributes does not gate on throttleAttributesPresent (throttle buckets are keyed by incarnation and are not invalidated there), and its throttleAttributeNames slice had no other use. The reaper walks the legacy prefix in reapQueueLegacy and each partition in reapQueuePartition, not the prefix pair the helper built; the comment that cited the helper now names them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
None of these is called outside its own tests: - ResolveCommitTS and ErrLastCommitTSRegression: the encode CLI enforces the same fail-closed --last-commit-ts floor in resolveLastCommitTS, whose tests cover the regression. - peekMsgDataKey and HasInlineTTL, test/debug helpers in production code. - IsBlobAtomicWriteRetriable, IsBlobAtomicWriteOutOfSpace and the per-platform isDiskFullError files only they used. - IsBinarySegment; the round-trip tests check the binary prefix directly. - effectivePartitionCount, which the encoder deliberately never uses for its gates; the comments now name the adapter's helper. - WriteChecksumsWithVirtualFile, a wrapper over the Context variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
- redisTranscoder (redis_transcord.go) was wired into RedisServer but no command path used it; its property test went with it, and CLAUDE.md no longer cites the test. - selectXReadEntries had no caller since XREAD reads the entry-per-key layout, and unmarshalStreamValue / redisStreamValueFromProto decoded the legacy single-blob stream that loadStreamAt deliberately discards (PR #620). Their benchmarks and the codec round-trip test are removed. - marshalStreamValue and redisStreamValueToProto now live in a test file: production never writes the legacy blob, and the tests use them only to seed legacy data and check that it is ignored and cleaned up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
ObserveSnapshot, ReadCommittedWindows and their SnapshotSource / SnapshotReadConfig / SnapshotReadResult types have no production caller: the scheduler reads committed columns itself and runs CommittedWindowsFromColumns plus Evaluate. The four ObserveSnapshot reset tests now drive that same pair through evaluateCommittedColumns with unchanged assertions. The test that only pinned ReadCommittedWindows' own fetch range goes with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
The live startup guard is checkLocalEpochRollbackBeforeBump / checkLocalEpochRollbackAfterBump in main_encryption_startup_guard.go, which allows sidecar == registry before the startup bump, requires sidecar > registry after raft replay, and refuses a foreign registry row. CheckLocalEpochRollback encoded the older single-shot rule, had no caller, and its tests pinned that contradicting rule. The comments that pointed at it now name the live checks, whose own tests cover the rollback, equal-epoch, missing-row and foreign-row cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
The one-time FSM-store migrator has no production caller. Its only other users were two root startup-guard tests that needed a data directory with a given persisted peer list; they now seed it through the production PreparePhysicalSnapshotRestore path, and forcing the guard to ignore persisted peers still fails both. finalizeMigrationDir and errMigrationDestinationExists, which the external snapshot restore uses, move into external_snapshot_restore.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
Production only reads the pre-WAL state files: loadLegacyOrSplitState migrates them into the WAL on Open. loadOrCreateState, the old load-or-bootstrap entry point, had no caller, and with it bootstrapState, saveSplitState, rewriteEntriesFile and removeFileIfExists. Its migration test goes too; TestOpenRestoresLegacySnapshotState covers the live path. saveStateFile, encodeStateFile, saveMetadataFile and writeMessage are still needed to seed legacy data directories in tests, so they move to persistence_legacy_writers_test.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fm5mogKjCk6edosPUsnMWZ Signed-off-by: bootjp <contact@bootjp.me>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (55bf5a3):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
TLA+ spec divergence review (auto-triggered)This PR touches files that the TLA+ safety spec has an anchor on (per Anchored files changed in this PR head (55bf5a3):
What to check, by subsystem:
If the change is correct but requires a spec update, edit @claude review please verify TLA+ spec divergence per the checklist above. @codex review please verify TLA+ spec divergence per the checklist above. |
|
Why it is not this PR's: this PR does not touch Root cause: Proposed fix (test-only): connect before measuring, so the timeout covers only the RPC. Verified locally with @@ func TestLeaderRoutedStore_GlobalLastCommitTS_ProxiesToLeader(t *testing.T) {
s := NewLeaderRoutedStore(store.NewMVCCStore(), coord)
t.Cleanup(func() { _ = s.Close() })
+ // GlobalLastCommitTS gives the proxy RPC globalLastCommitTSTimeout and
+ // falls back to the local value on timeout. Connect first so the dial
+ // does not spend that budget under a loaded parallel -race run.
+ conn, err := s.connCache.ConnFor(addr)
+ require.NoError(t, err)
+ conn.Connect()
+ require.Eventually(t, func() bool { return conn.GetState() == connectivity.Ready }, 5*time.Second, 10*time.Millisecond)
+
ts := s.GlobalLastCommitTS(context.Background())The fix also needs the Generated by Claude Code |
Design: docs/design/2026_10_16_partial_test_suite_cleanup.md
Summary
Implements the "Production dead code that is only tested" follow-up from the test-suite cleanup design. Before each deletion I re-checked that the code has no production caller on current
main. Where a test exercised live behaviour through the dead code, the test was ported to the live path first. One commit per area:monitoring:observeLeaderChange(duplicate of the inlineIncinsetLeaderMetric)setLeaderMetric. Mutation: dropping the inlineIncfails it.fskeys:ChunkRouteHomeFromKeyTestChunkRoutePartsFromKey.adapter:(SQS)throttleAttributesPresentplus its name slice;sqsMsgByAgePrefixesForQueuesetQueueAttributesnever gated on the helper. The reaper walks legacy and per-partition prefixes itself, and the comment now names those functions.backup:ResolveCommitTS/ErrLastCommitTSRegression,peekMsgDataKey,HasInlineTTL,IsBlobAtomicWrite*plus thedisk_full_*.gofiles,IsBinarySegment,effectivePartitionCount,WriteChecksumsWithVirtualFile--last-commit-tsfloor is enforced and tested in the encode CLI'sresolveLastCommitTS.adapter:(Redis)redis_transcord.goand its property test (CLAUDE.md citation updated);selectXReadEntries;unmarshalStreamValue/redisStreamValueFromProtoand their benchmarksloadStreamAtdeliberately discards legacy blobs (PR #620).marshalStreamValuemoved to a test file, where it remains the legacy-blob fixture for the cleanup tests.autosplit:ObserveSnapshot,ReadCommittedWindowsand their three typesCommittedWindowsFromColumns+Evaluate, as the scheduler does, with unchanged assertions.encryption:CheckLocalEpochRollbackcheckLocalEpochRollbackBeforeBump/AfterBumpguard; that guard has its own rollback, equal-epoch, missing-row and foreign-row tests. Comments now name the live checks.etcd:MigrateFSMStorePreparePhysicalSnapshotRestore. Mutation: making the guard ignore persisted peers fails both.finalizeMigrationDir/errMigrationDestinationExistsmove toexternal_snapshot_restore.go, which uses them.etcd:loadOrCreateState,bootstrapState,saveSplitState,rewriteEntriesFile,removeFileIfExistsTestOpenRestoresLegacySnapshotStatecovers the live legacy migration (loadLegacyOrSplitState). The pre-WAL writers that tests use to seed legacy directories moved topersistence_legacy_writers_test.go.docs:Not removed.
distribution.IsCatalogDeltaKey: it has a production caller inkv/raft_bootstrap_guard.go.With*options set only by tests, mostly clock, interval, logger and timeout seams, so each needs a separate decision. This is left open in the doc.Behaviour change
None at run time; every removed symbol was unreachable from production code. Net change is −1,400 lines.
Test evidence
go build ./...: passes.GOOS=windows go build ./internal/backup/: passes (the deleteddisk_full_windows.gowas the only Windows-specific file there). The full Windows build fails in the vendored go-fuse, as onmain.go test -racepasses on monitoring, fskeys, backup, autosplit, encryption and the snapshot-encode CLI.go testpasses on etcd, the root startup-guard tests, and the adapter SQS and Redis subsets. The one exception isTestFinalizeAsFSMFile_RenameFailureCleansUpSpool, which fails identically onmainin a root container (chmoddoes not block writes for root).golangci-lint v2.15.0 --new-from-rev=origin/main ./...: 0 issues.Self-review (five lenses)
RedisServerloses one unused field.resolveLastCommitTS, the reaper's own prefix walks,CommittedWindowsFromColumns+Evaluate,PreparePhysicalSnapshotRestore) are what the ported tests now exercise.Generated by Claude Code