A store started after its node connected never joins: the coordinator acts only on nodeup #15
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 (reliability): a cluster-mode store that starts after its node is already connected to a peer joins that peer's cluster, with no call from the application.
What happens (reckon_db 5.12.0)
reckon_db_store_coordinator:init/1attempts no join. A node joins only on anodeup(reckon_db_node_monitor) or an explicitjoin_cluster/1.reckon_db_node_monitorasksshould_handle_nodeup/1, which answersfalsewhile the coordinator is not yet registered.Found on
mcl-whiteboard#6 (A3 package 2), in a two-peer ExUnit test: node A runs the store and connects to B while B's store is still starting. In A's log,
Elected coordinator among store-runners [B]repeats every 3-8 s. B logs no join attempt. An explicitjoin_cluster/1on B joins at once (coordinatoron A,okon B). In a release the same order is likely: a clustering layer (macula_cluster gossip in mcl-martha) connects the nodes before the services open their stores.Workaround in use
mcl-whiteboard calls
reckon_db_store_coordinator:join_cluster/1once after starting a cluster-mode store. Ano_nodesorwaitingresult starts the coordinator's own retry loop.Done when
join_cluster/1call from the application. Proved by a two-peer suite that connects the nodes before the second store starts.Refs macula-services/mcl-whiteboard#6
Closed. Folded into reckon-db#14 by the Supervisor, landed in
acc1aa94(PR 16), shipped as reckon_db 5.12.1 on hex.Done-when: a cluster-mode store now starts its own join loop (
join_on_start/1inreckon_db_store_coordinator), so it joins a store-runner its node is already connected to without anyjoin_cluster/1call. Proved bytest/integration/reckon_db_cluster_join_on_start_SUITE.erl, casea_store_started_after_its_node_connected_joins: two peers are connected before the second store starts. The case is red on 5.12.0 and green onacc1aa94(CI runs 6849, 6850, 6851). The join loop keeps one pending retry (a new one cancels the old), so the retry chains no longer multiply. The #2 guard still refuses a join over events.Mercurius's accepted note: a lone cluster node retries every 3-8 s at info level.