Repository navigation
docs: record the CAS decision where the code claims otherwise - #286
Merged
Merged
Conversation
#169's evaluation recommended per-key S3 compare-and-swap over the Raft build-out. That recommendation is adopted: #128, #130, #133 and #151 are closed as not-the-direction, and #282-#285 are filed in their place. The code said otherwise in four places, and this is the commit that stops it saying so. `internal/distributed/doc.go` called the direction "the open question" and listed configuration changes, quorum decisions, Multi-Raft and consistent snapshots as things the package does or will do — none of which is true or going to be. `consensus.go` described ConsensusEngine as "a Raft-like consensus algorithm" without mentioning that it replicates nothing: applyLogEntry has three empty arms and no caller appends an operation entry, so the log holds one bootstrap noop plus one entry per election win. Removed rather than reworded, in both files, where the claim presupposed the replicated log. A "planned for future releases" list is the easiest place in a repo for a dropped direction to survive, because nothing compiles against it. Two corrections to the design doc, found by acting on it and recorded in the doc rather than smoothed over: - Its closure list of four omitted #150, whose own Background states it implements the #128 and #130 interfaces in bbolt. Left open and commented, since it was outside the approved set. - Its `doc.go` linearizability correction, listed as owed either way, had already landed. Also noted for whoever picks up #284: the taxonomy is not three levels differing in PUT count, it is three names for two behaviours. ConsistencySession and ConsistencyEventual are now nearly the same function — both execute on targetNodes[0] and then replicateAsync the remainder — and session has no session state anywhere to make its promise true. Milestone titles updated: v0.13.0 was "Cache Warming, Raft Persistence & Operational Excellence" and #150/#151 were the Raft Persistence. Refs #169, #282, #283, #284, #285
scttfrdmn
enabled auto-merge (squash)
August 3, 2026 19:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-through on the direction decision for #169: per-key S3 compare-and-swap replaces the Raft build-out.
Issue changes already made outside this PR: closed #128, #130, #133, #151 (
resolution: wontfix, each with its specific reason); opened #282 (Backend.PutObjectIf+ sentinels + capability probe), #283 (a lease whose every guarded action re-asserts the CAS), #284 (remove the fan-out, fix the taxonomy), #285 (verify MinIO/Wasabi against real endpoints); commented #129 and #144, both of which consume the taxonomy #284 removes, so they are not implemented as written.What this PR changes
internal/distributed/doc.goandconsensus.goboth documented the Raft direction as live. Specifically:doc.go: "Whether that gets built out as Raft or replaced by per-key conditional writes is the open question"doc.go: leader handles "configuration changes" and "quorum decisions"broadcastProposalslept and accepted its own proposal — and leadership is documented as a hint, not a guarddoc.go: future enhancements include "Multi-Raft for better scalability", "consistent snapshots"consensus.go: "implements a Raft-like consensus algorithm"Removed rather than reworded wherever the claim presupposed the replicated log. A "planned for future releases" list is the easiest place for a dropped direction to survive, because nothing compiles against it.
Two corrections to the design doc
Both found by acting on it, and recorded in the doc rather than smoothed over:
BboltPersistentState/BboltConsensusLog), whose own Background says it implements the A1-1: Define ConsensusLog interface and in-memory implementation #128 and A1-3: Add PersistentState interface — Raft safety prerequisite #130 interfaces. It is left open and commented, not closed — it was outside the four-issue set that was approved, so closing it would be extending scope on my own inference. Recommendation on the issue is to close it alongside the others.doc.golinearizability correction had already landed before adoption; §5 still listed it as owed.The "If not adopted" section is kept, retitled "The road not taken," because the case against a decision is worth preserving beside it — and if CAS hits the §2 ceiling, the alternative is already costed there.
Worth knowing for #284
The taxonomy is not three levels differing in PUT count. It is three names for two behaviours:
ConsistencySessionandConsistencyEventualare now nearly the same function — both execute ontargetNodes[0]thenreplicateAsyncthe remainder — and session has no session state anywhere to make its "same node for related operations" comment true.ConsistencyStrongis the mislabeled fan-out. That is why #284 carriesbreaking change.Note also that closing the issues stopped the build-out but did not remove the ~6,000 lines that already elect leaders and replicate nothing. #284 is where the first of that comes out.
Milestones retitled: v0.13.0 was "Cache Warming, Raft Persistence & Operational Excellence" — #150 and #151 were the Raft Persistence.
Gates
go build ./.../go vet ./.../gofmt -l .go test -count=1 -race -covermode=atomic ./...coverage-gate.shgolangci-lint --new-from-merge-base=origin/main./internal/distributed/G404s in the election-timeout jitter./internal/config/)go test -race ./internal/distributed/Docs-only; no behaviour change.