Fix cluster not responding after restart

Two bugs prevented the cluster from working after a stop/start cycle:

1. tcp_listen_tcp() and tcp_listen_tls() had reuse_addr set to false,
   causing bind() to fail with EADDRINUSE when ports are in TIME_WAIT
   state after a restart. Set SO_REUSEADDR to true.

2. The vsr_boot_marker file (created in CWD on first boot) was never
   cleaned up on cluster stop. On restart, all nodes would enter
   STATUS_RECOVERY, but since RECOVERY messages are only processed by
   nodes in STATUS_NORMAL, the entire cluster would deadlock with no
   node able to recover. Remove the marker in cluster.sh stop.

https://claude.ai/code/session_01U72omHJrk95xFwm22Rkqgt
This commit is contained in:
Claude
2026-02-26 01:02:21 +00:00
parent 7cd124e939
commit d56181503e
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -138,6 +138,7 @@ do_stop() {
stop_process "node1"
stop_process "node2"
stop_process "node3"
rm -f "$SCRIPT_DIR/vsr_boot_marker"
echo "Cluster stopped."
}