Repository navigation
Cluster features are declared and raised through the log - #683
Merged
matrixarkai merged 1 commit intoNov 18, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Reversible in this build, with one thing to know: this adds a new metadata request code (96) and a new committed outcome version (14). Nothing in this change sends either on its own, so a mixed set of builds is unaffected until an operator runs the new command. An old voter that meets a version 14 entry fails to apply it (the same strict re-encode check every outcome has); it never skips it. That is why the raise is refused until every named voter has declared support.
Stacked on #4a-1 (the cluster feature set in the metadata snapshot); the first two commits are that PR.
What
src/cluster/features_commands.rs:FeaturesRequestwith three actions.bits. The caller names every voter of the group (ascending). Refused unless every named voter has declared every requested bit and this build reads the bits itself. A bit is never lowered; raising what is raised proposes nothing.PlacementOutcomeversion 14 with afeaturesfield (tag 16): the whole set before and after. It carries nothing else (validation refuses any other state in the same outcome), changes either one voter's declaration or the raised bits (never both), never removes a voter, never lowers a bit, refuses a bit this build cannot read. Applied only against exactly the set it was decided from and the metadata index it was decided at, so a leader change between decision and commit cannot slip a bit past the check.MetaRequestCode::Features = 96, request and reply plumbing in the message, consensus, server and client; client methodsread_cluster_features,declare_voter_features,raise_cluster_features.What an old node does
A voter or journal reader that does not know version 14 or the
featuresfield fails to apply the entry (the outcome is re-encoded and compared byte for byte, so an unknown field is corruption, not ignored). Nothing is skipped. The raise command is the protection: it is refused unless every named voter declared the bits, and a voter only declares bits it reads.Known limits, to be closed in the next part
Tests (
cluster::features_commands::tests, 7, plus the 7 of the snapshot part)Declaration recorded once and repeat is a no-op; a mixed set (one voter without the feature, or with one of two bits) keeps the bit low and a refused raise writes nothing; an unnamed voter and an unknown bit are refused; an outcome applies only to the set it was decided from (a declaration that commits in between makes it stale, and it cannot apply twice); strict outcome shape (lowering, two voters, removal, raise plus declaration, no change, unknown bit, wrong version, extra index); replay of the log from the start and a late joiner (snapshot after entry 2, then entries 3 and 4) reach the same set; canonical request shape and the request code.
Planted defects, each caught (undone by edit): raise skips the voter check, apply skips the bound-set check, a bit may go down, a repeated declaration is proposed again, voters need not be ascending.
Numbers
Control-plane only; no data path changed, so instructions per append and per read are unchanged. Cost of a declaration or a raise: one metadata log entry (a version 14 outcome of about 50 bytes plus 16 bytes per declared voter, twice: before and after), once per upgrade step, never per request.
🤖 Generated with Claude Code