Skip to content

Remove the Witness DC role; collapse to Member and Arbiter#51

Open
tamalsaha wants to merge 1 commit into
dc-dr-failover-policyfrom
remove-witness-role
Open

Remove the Witness DC role; collapse to Member and Arbiter#51
tamalsaha wants to merge 1 commit into
dc-dr-failover-policyfrom
remove-witness-role

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

The DC failover topology has exactly two kinds of data center:

  • Member: holds data, votes, primary-eligible.
  • Arbiter: empty replicaIndices, holds no data, never primary, votes for tie-breaking (runs the dr-controlplane failover service, plus for geo-quorum engines a data-less engine voter the operator places there).

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 in the Arbiter DC, not a data-bearing member. Witness was only just added (this branch) and has never shipped, so removing the enum value breaks nothing in use.

Changes

  • DCRole: drop the DCRoleWitness constant, the +kubebuilder:validation:Enum value, and the doc lines (enum is now Member;Arbiter).
  • ClusterSpreadConstraint.Validate(): drop the witnesses counter and the Witness branch; TwoDC now requires exactly two Members and at least one Arbiter (error text updated).
  • Webhook comment and the FailoverModeTwoDC / FailoverPolicy.Mode comments updated to Member/Arbiter.
  • Regenerated the PlacementPolicy CRD (controller-gen): role enum drops Witness.
  • Added Validate tests: TwoDC requires an Arbiter, and a Witness role is now rejected as an unknown role.

Based on dc-dr-failover-policy (where the Role field was introduced; it is not yet on master). go build, go vet, and go test ./apis/... ./pkg/webhooks/... pass. dr-controlplane and the db operators re-vendor afterward in their own PRs.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant