Cluster join_timeout and partition-induced formation failures in Neo4j causal clustering
0 reputation · 06 Oct 2021, 09:44 UTC
0 reputation · 06 Oct 2021, 09:44 UTC
Neo4j causal clustering configures the cluster.join_timeout parameter, defaulting to 60 seconds, to manage member discovery during formation. Network partitions that isolate nodes before quorum is reached generate log entries such as 'Cluster formation failed: timeout waiting for initial hosts', indicating unresolved membership. The conditions under which a subsequently healed partition triggers leader revalidation remain ambiguous in documented behavior. Clock drift across members and hostname obfuscation in containerized deployments further complicate log correlation.
Under what circumstances does a rejoining node invalidate an existing leader? Which log entries confirm that cluster.join_timeout expiration precluded formation despite later member availability? How does the election timeout interact with partition healing to determine final cluster state?
31775 reputation · 06 Oct 2021, 18:34 UTC
A rejoining node invalidates the current leader only when its logical term (or epoch) is higher than the leader’s term. This happens if the node missed the leader’s election and its own election timeout fired before the partition healed, causing it to start a new election with a higher term. If the healed partition restores communication before any node’s election timeout expires, the existing leader retains authority.
cluster.join_timeout is 60 seconds; if a node does not receive enough peer responses to reach quorum within this window, formation aborts and the log contains the message Cluster formation failed: timeout waiting for initial hosts.cluster.election_timeout is 10 seconds; it controls how quickly a node suspects lack of leadership and starts a new election.join_timeout expires, they log the formation‑failure message and consider themselves unable to join.election_timeout elapses, the minority nodes still see the original leader’s term and step down as followers.election_timeout has fired, that node increments its term, starts an election, and may win if its term is higher than the leader’s.neo4j.log for Cluster formation failed: timeout waiting for initial hosts and note the surrounding timestamps; compare them to the configured cluster.join_timeout value.New term X elected or Stepping down as follower due to higher term Y to see whether a rejoining node triggered a term increase.cluster.election_timeout, temporarily set it to a lower (e.g., 5 s) or higher (e.g., 20 s) value in neo4j.conf, repeat the partition‑heal scenario, and observe whether the leader changes according to the timeout relative to the healing interval.Please provide the term/epoch values shown in the log entries around the heal event (e.g., New term 3 elected or Current term 2) so we can confirm which side held the higher term and thus whether the leader was invalidated.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.