Remove the Witness DC role; collapse to Member and Arbiter#51
Open
tamalsaha wants to merge 1 commit into
Open
Conversation
The DC failover topology has exactly two kinds of data center: Member (holds data, votes, primary eligible) and Arbiter (no data, never primary, vote only for tie-breaking). The Witness role meant "a third DC that holds data but is never primary," and that case no longer exists: a third site is either a data-less Arbiter or a full Member, and MongoDB's third-site vote is a data-less arbiter placed in the Arbiter DC, not a data-bearing member. Witness was only just added and never shipped, so removing the enum value breaks nothing in use. - DCRole: drop the DCRoleWitness constant, the enum value, and the doc lines. - ClusterSpreadConstraint.Validate(): drop the witnesses counter and the Witness branch; TwoDC now requires exactly two Members and at least one Arbiter. - Webhook and FailoverMode/FailoverPolicy comments updated to Member/Arbiter. - Regenerate the PlacementPolicy CRD (controller-gen): role enum is Member;Arbiter. - Add Validate tests: TwoDC needs an Arbiter, and Witness is now an unknown role. Signed-off-by: Tamal Saha <tamal@appscode.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.
The DC failover topology has exactly two kinds of data center:
replicaIndices, holds no data, never primary, votes for tie-breaking (runs thedr-controlplanefailover service, plus for geo-quorum engines a data-less engine voter the operator places there).The
Witnessrole meant "a third DC that holds data but is never primary," and that case no longer exists: a third site is either a data-lessArbiteror a fullMember, and MongoDB's third-site vote is a data-less arbiter in the Arbiter DC, not a data-bearing member.Witnesswas only just added (this branch) and has never shipped, so removing the enum value breaks nothing in use.Changes
DCRole: drop theDCRoleWitnessconstant, the+kubebuilder:validation:Enumvalue, and the doc lines (enum is nowMember;Arbiter).ClusterSpreadConstraint.Validate(): drop thewitnessescounter and theWitnessbranch;TwoDCnow requires exactly two Members and at least one Arbiter (error text updated).FailoverModeTwoDC/FailoverPolicy.Modecomments updated to Member/Arbiter.roleenum dropsWitness.Validatetests: TwoDC requires an Arbiter, and aWitnessrole is now rejected as an unknown role.Based on
dc-dr-failover-policy(where theRolefield was introduced; it is not yet on master).go build,go vet, andgo test ./apis/... ./pkg/webhooks/...pass. dr-controlplane and the db operators re-vendor afterward in their own PRs.