A holder already in the cluster it meets is answered refused (join race, #2 guard) #17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (fix): a node that holds events and is already a member of the cluster it meets answers
ok, notrefused, 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_eventsfailed at line 103: the holder B'sjoin_cluster/1returnedrefused. 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:already_clustered_locally/1sees one member.find_existing_cluster_nodes/2sees A as a multi-member cluster, sojoin_existing_cluster(A)runs, andjoin_unless_holding/2refuses 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
join_unless_holding/2(orjoin_existing_cluster/2) checks whether this node is already in the target's member set, and if so answersok.