Skip to content

fix(gateway): enable cluster sync without requiring BOOTNODE_URL#574

Merged
kvinwang merged 1 commit intomasterfrom
fix/gateway-cluster-sync-bootstrap
Mar 19, 2026
Merged

fix(gateway): enable cluster sync without requiring BOOTNODE_URL#574
kvinwang merged 1 commit intomasterfrom
fix/gateway-cluster-sync-bootstrap

Conversation

@kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Mar 19, 2026

Summary

  • Fix chicken-and-egg bootstrap problem: SYNC_ENABLED was previously tied to BOOTNODE_URL being set, so the first node in a cluster could never enable sync
  • Now sync is enabled whenever NODE_ID > 0, and peers are auto-discovered via incoming sync connections (WaveKV's handle_sync adds the sender as a peer)
  • BOOTNODE_URL remains optional — it speeds up initial discovery but is no longer required

Test plan

  • Deploy gateway-1 with NODE_ID=1 and no BOOTNODE_URL → verify sync is enabled
  • Deploy gateway-2 with NODE_ID=2 and BOOTNODE_URL pointing to gateway-1 → verify both nodes discover each other and sync

Previously, SYNC_ENABLED was tied to BOOTNODE_URL being set, creating a
chicken-and-egg problem: the first node in a cluster had no bootnode to
point to, so sync was disabled entirely.

Now sync is enabled whenever NODE_ID > 0. Peer auto-discovery works via
incoming sync connections — when another node syncs to us, WaveKV's
handle_sync automatically adds the sender as a peer. BOOTNODE_URL remains
optional for speeding up initial discovery.
@kvinwang kvinwang enabled auto-merge (squash) March 19, 2026 02:16
@kvinwang kvinwang disabled auto-merge March 19, 2026 02:29
@kvinwang kvinwang merged commit d5eb4a4 into master Mar 19, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant