Skip to content

fix(etcd): make member join replay idempotent - #3235

Draft
weicao wants to merge 3 commits into
mainfrom
martin/etcd-memberjoin-idempotency
Draft

fix(etcd): make member join replay idempotent#3235
weicao wants to merge 3 commits into
mainfrom
martin/etcd-memberjoin-idempotency

Conversation

@weicao

@weicao weicao commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What this fixes

Closes #3234.

memberJoin no longer blindly adds a member on every lifecycle-action replay.
It now reads authoritative membership before mutation, adds an absent member at
most once, and verifies membership again after the add attempt.

Behavior

  • Exact existing member: success without mutation.
  • Unstarted member with the expected peer URL: success without mutation.
  • Same name with another peer URL: fail closed.
  • Same peer URL with another nonempty name: fail closed.
  • Absent member: one add attempt followed by an authoritative post-read.
  • Query failure, malformed fields output, or unobserved registration: fail
    closed with retry classification.

The fields parser validates decimal member IDs, quoted Name values, nonempty
quoted PeerURL values, and duplicate Name fields. Multiple valid PeerURL fields
remain supported.

Verification

  • Genuine TDD reds: focused 31 examples / 4 failures for malformed fields,
    then 34 examples / 2 failures for the quoted-empty PeerURL boundary.
  • Focused memberJoin ShellSpec: 34/0.
  • Full etcd script ShellSpec: 69/0.
  • Alice reviewer mutant harness: pass on Bash 5.3 and BusyBox 1.37, including
    production add_member returning rc=1 with zero add calls for malformed
    input.
  • BusyBox 1.37: both byte-exact etcd fixtures classify as
    unstarted-registered; legal multiple-PeerURL input classifies as exact.
  • Bash 3.2 and 5.3 parse, ShellCheck error severity, Helm lint, and Helm render:
    pass.

Fixture SHA-256 values remain unchanged:

  • etcd 3.5.15: 25406312dafba48e31b88157df628f4c1f0691928f9a3b0e804f4930e24cc9d6
  • etcd 3.6.12: c950babd452e3243e74a3d74c5584bd4fa26224077d13f62955e0ae04c245769

The full base diff has two intentional git diff --check findings: the final
blank line in each real-output fixture is an exact captured block delimiter and
is protected by the fixture SHA.

@weicao
weicao requested review from a team and leon-ape as code owners July 18, 2026 01:20
@weicao
weicao marked this pull request as draft July 18, 2026 16:18
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.

[BUG] etcd memberJoin replay fails after member registration

1 participant