A holder already in the cluster it meets is answered refused (join race, #2 guard) #17

Open
opened 2026-12-02 11:41:46 +00:00 by neptunus · 0 comments
Member

Purpose (fix): a node that holds events and is already a member of the cluster it meets answers ok, not refused, so the higher_named_holder_keeps_its_events case cannot go red under load.

Refs reckon-db-org/reckon-db#2 (the join guard), found while gating reckon-db-org/reckon-db#14 r2.

What happened

In a local gate on acc1aa9 (two gates overlapping, so the box was under double load) reckon_db_cluster_join_keeps_events_SUITE:higher_named_holder_keeps_its_events failed at line 103: the holder B's join_cluster/1 returned refused. Run alone afterwards, the suite passed 3/3. It was green on CI for #2 and #14 r1.

Cause (reading the code)

Two joins run at the same time: B's explicit join_cluster/1, and A's own (nodeup, or the join_on_start loop from #15). A is empty, so it joins B, which is correct. The window:

  1. B's already_clustered_locally/1 sees one member.
  2. A finishes joining B. A now reports two members.
  3. B's find_existing_cluster_nodes/2 sees A as a multi-member cluster, so join_existing_cluster(A) runs, and join_unless_holding/2 refuses because B holds events.

B is already in that cluster, so nothing is lost: no reset runs, and the retry loop stops once it sees the cluster has more than one member. The only harm is that the answer is wrong, and the test asserts the answer.

Done when

  • Before it refuses, join_unless_holding/2 (or join_existing_cluster/2) checks whether this node is already in the target's member set, and if so answers ok.
  • A unit or CT case drives that window in a fixed order, and it fails on the current code.
  • The #2 guard stays: a holder that is not a member of the cluster it meets is still refused, and the existing cases stay green.
Purpose (fix): a node that holds events and is already a member of the cluster it meets answers `ok`, not `refused`, so the higher_named_holder_keeps_its_events case cannot go red under load. Refs reckon-db-org/reckon-db#2 (the join guard), found while gating reckon-db-org/reckon-db#14 r2. ## What happened In a local gate on acc1aa9 (two gates overlapping, so the box was under double load) `reckon_db_cluster_join_keeps_events_SUITE:higher_named_holder_keeps_its_events` failed at line 103: the holder B's `join_cluster/1` returned `refused`. Run alone afterwards, the suite passed 3/3. It was green on CI for #2 and #14 r1. ## Cause (reading the code) Two joins run at the same time: B's explicit `join_cluster/1`, and A's own (nodeup, or the join_on_start loop from #15). A is empty, so it joins B, which is correct. The window: 1. B's `already_clustered_locally/1` sees one member. 2. A finishes joining B. A now reports two members. 3. B's `find_existing_cluster_nodes/2` sees A as a multi-member cluster, so `join_existing_cluster(A)` runs, and `join_unless_holding/2` refuses because B holds events. B is already in that cluster, so nothing is lost: no reset runs, and the retry loop stops once it sees the cluster has more than one member. The only harm is that the answer is wrong, and the test asserts the answer. ## Done when - [ ] Before it refuses, `join_unless_holding/2` (or `join_existing_cluster/2`) checks whether this node is already in the target's member set, and if so answers `ok`. - [ ] A unit or CT case drives that window in a fixed order, and it fails on the current code. - [ ] The #2 guard stays: a holder that is not a member of the cluster it meets is still refused, and the existing cases stay green.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
reckon-db-org/reckon-db#17
No description provided.