Files
seaweedfs/weed/server
pingqiuandClaude Opus 4.6 334c12664a fix: CP13-8A P0 — post-promote primary refresh with replica addresses
Bug: After failover promotes a replica to primary, the old primary
re-registers via heartbeat as a replica (lower epoch). But the master
never sent an updated Primary assignment to the new primary with the
re-registered replica's addresses. The new primary had 0 shippers →
replication dead. sync_all barrier passed vacuously.

Root cause: upsertServerAsReplica (heartbeat reconciliation) added the
re-registered server to Replicas[] but didn't (a) populate DataAddr/
CtrlAddr from heartbeat info, or (b) trigger a primary assignment
refresh.

Fix:
- master_block_registry.go: upsertServerAsReplica now copies DataAddr/
  CtrlAddr from heartbeat info and sets NeedsPrimaryRefresh flag.
  UpdateFullHeartbeat returns HeartbeatResult with PrimaryRefreshNeeded
  entries. DrainPrimaryRefreshNeeded collects and clears the flag.
- master_block_failover.go: add enqueuePrimaryRefresh — builds a
  Primary assignment with all current replica addresses and enqueues it.
- master_grpc_server.go: heartbeat handler processes PrimaryRefreshNeeded
  entries after UpdateFullHeartbeat.

Gate test: TestPromote_AssignmentHasReplicaAddrs now PASSES —
after promote + re-register, the new primary gets an assignment with
replicaDataAddr=vs1:14260 and replicaAddrs=1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 13:59:43 -07:00
..
2019-03-03 10:17:44 -08:00
2025-12-26 13:26:25 -08:00
2026-02-20 18:42:00 -08:00