Skip to content

Commit ee2c09f

Browse files
author
SqlRush
committed
test(cluster): pin evidence-over-inference own-commit latch (known-red)
The leaving node's barrier-tick own-commit latch must be backed by direct evidence (the durable COMMITTED marker confirmation for THIS leave attempt) and must be immune to third-party transient false-DEAD flap noise: the scalar dead_generation is monotone, so a flap during the leave window advances it forever and the r2 P2-1 three-conjunct inference then refuses a healthy committed leave until the barrier deadline escalates it (nightly t/331 C1/C4 false-escalation, run 28948167577). The reworked U3b matrix pins: (a) evidence, no noise -> latch (d) evidence + flap noise -> still latch (RED on current code) (c) no evidence, any noise state -> never latch (deadline escalation stays armed; the r2 P2-1 refused-leave mis-latch wedge stays shut) Known-red TDD commit: leg (d) fails on the current three-conjunct predicate; the follow-up commit flips the latch to marker evidence. Spec: spec-2.29a-reconfig-marker-async-lmon-liveness.md
1 parent 1be30fe commit ee2c09f

1 file changed

Lines changed: 30 additions & 17 deletions

File tree

src/test/cluster_unit/test_cluster_clean_leave.c

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,44 @@ UT_TEST(test_version_coherent)
185185

186186

187187
/* ============================================================
188-
* U3b — leaver barrier-tick own-commit latch (spec-2.29a r2 P2-1)
188+
* U3b — leaver barrier-tick own-commit latch (spec-2.29a r3, evidence
189+
* over inference)
189190
* ============================================================ */
190191

191192
UT_TEST(test_own_commit_latched)
192193
{
193-
/* own commit latches only when the epoch advanced AND both the others-dead
194-
* bitmap and the scalar dead_generation are unchanged. */
195-
196-
/* clean commit: epoch advanced, nothing else moved -> latch */
194+
/* The latch verdict is EVIDENCE-only: the first argument is "the durable
195+
* COMMITTED marker for THIS leave attempt was confirmed" (the coordinator's
196+
* nonce-bound LEAVE_COMMITTED attestation). The two coherence observations
197+
* (others-dead bitmap / scalar dead_generation) stay in the signature as
198+
* contract inputs the verdict must IGNORE — a third-party transient
199+
* false-DEAD flap on the leaver's local CSSD view advances the (monotone)
200+
* dead_generation and can transiently disturb the bitmap, and neither may
201+
* refuse a latch that marker evidence backs (the t/331 C1/C4 false-
202+
* escalation), nor may any combination latch without evidence (the r2 P2-1
203+
* refused-leave mis-latch hang). */
204+
205+
/* (a) evidence present, no flap noise -> latch */
197206
UT_ASSERT(cluster_clean_leave_own_commit_latched(true, true, true));
198207

199-
/* epoch has not advanced yet -> not our commit (keep waiting) */
200-
UT_ASSERT(!cluster_clean_leave_own_commit_latched(false, true, true));
201-
202-
/* a third-party death is currently in the others-dead set -> escalate */
203-
UT_ASSERT(!cluster_clean_leave_own_commit_latched(true, false, true));
208+
/* (d) PINNING LEG (t/331 C1/C4 regression): a third-party flap advanced the
209+
* scalar dead_generation (it never rebounds) while the bitmap rebounded to
210+
* its bound value — WITH marker evidence the leave still latches; the flap
211+
* must not false-escalate a committed leave. */
212+
UT_ASSERT(cluster_clean_leave_own_commit_latched(true, true, false));
204213

205-
/* r2 P2-1 rebound case: the others-dead bitmap has REBOUND to its bound
206-
* value (a third-party false-DEAD then recovered) but the scalar
207-
* dead_generation ADVANCED — the non-monotone bitmap must NOT be trusted;
208-
* the scalar conjunct forces escalate instead of a false latch/hang. */
209-
UT_ASSERT(!cluster_clean_leave_own_commit_latched(true, true, false));
214+
/* (d) flap currently visible in the others-dead bitmap too -> still latch */
215+
UT_ASSERT(cluster_clean_leave_own_commit_latched(true, false, true));
216+
UT_ASSERT(cluster_clean_leave_own_commit_latched(true, false, false));
210217

211-
/* both diverged -> escalate */
212-
UT_ASSERT(!cluster_clean_leave_own_commit_latched(true, false, false));
218+
/* (c) no evidence -> never latch, whatever the coherence observations say
219+
* (a refused leave never produces a COMMITTED marker, so the barrier
220+
* deadline escalation stays armed and bounds the wait — the r2 P2-1
221+
* mis-latch wedge stays closed). */
222+
UT_ASSERT(!cluster_clean_leave_own_commit_latched(false, true, true));
223+
UT_ASSERT(!cluster_clean_leave_own_commit_latched(false, true, false));
224+
UT_ASSERT(!cluster_clean_leave_own_commit_latched(false, false, true));
225+
UT_ASSERT(!cluster_clean_leave_own_commit_latched(false, false, false));
213226
}
214227

215228

0 commit comments

Comments
 (0)