Skip to content

test(chk): deterministic split-brain red test for CHK scale-up - #2054

Draft
filimonov wants to merge 1 commit into
Altinity:0.27.3from
filimonov:chk-raft-split-brain-redtest
Draft

test(chk): deterministic split-brain red test for CHK scale-up#2054
filimonov wants to merge 1 commit into
Altinity:0.27.3from
filimonov:chk-raft-split-brain-redtest

Conversation

@filimonov

Copy link
Copy Markdown
Member

Deterministic split-brain test for CHK Raft scale-up

Adds test_020005_2 — an e2e test that deterministically reproduces the Raft split-brain window during ClickHouseKeeperInstallation scale-up. Companion to #2041 (the fix): RED on the current release branch, GREEN with #2041 applied.

Why: the existing happy-path scale-up test passes even on the pre-fix operator — the split-brain window self-heals within the assertion's retry budget, so it can't catch the bug. This test forces the window open and makes it observable.

How: partition the sole existing member (pod0) from all pod-to-pod traffic, then request scale 1→3. A fire-and-forget operator brings both fresh pods up at once; they form their own 2-of-3 majority and elect a leader without pod0 — split-brain. A safe operator stages members one at a time behind a committed-membership barrier, so with pod0 unreachable pod2 is never created and the lone pod1 can never elect. Invariant asserted: while pod0 is partitioned, no leader may emerge among the fresh nodes {1,2}.

Verified locally:

CI: partitioning is done at the node level via docker exec minikube iptables (+ conntrack flush) — no pod NET_ADMIN, no in-image iptables — so it runs on the GitHub Actions minikube (driver: docker). A read-back "partition is real" check fails loudly rather than yielding a false green.


Draft / demonstration: this branch is based on 0.27.2 and carries only the test (no operator fix), so its CI is expected to be RED on this base — that red is the point. Merging #2041 turns it green.

Add test_020005_2: partition the sole existing keeper (pod0) from pod-to-pod
traffic, then request scale 1->3. A fire-and-forget operator brings both fresh
pods up at once; they form a 2-of-3 majority and elect a leader without pod0 --
split-brain. A safe operator stages members one at a time behind a committed-
membership barrier, so with pod0 unreachable pod2 is never created and the lone
pod1 cannot elect. Invariant: while pod0 is partitioned no leader may emerge
among the fresh nodes {1,2} -- RED on the pre-fix operator, GREEN on the fixed.

Partitioning is done at the node level via 'docker exec minikube iptables'
(no pod NET_ADMIN, no in-image iptables), so it runs on the GitHub Actions
minikube (driver: docker). A read-back 'partition is real' check from pod1
fails the test loudly rather than yielding a false green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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