feat: Phase 16M/17 + promote fixes + testrunner updates

Phase 16M: explicit replica readiness on heartbeat seam
- master.proto: optional bool replica_ready = 19 (proto regenerated on M01)
- block_heartbeat_proto.go: write/read ReplicaReady with presence semantics
- master_block_registry.go: replicaReadyObservedFromHeartbeat prefers
  explicit proto field, falls back to address heuristic when absent
- volume_server_block.go: heartbeat emits ReplicaReady from core projection

Phase 17: host effects extraction + stop line
- phase-17-log.md: Batch 10/11 delivery notes

Promote fixes:
- master_block_failover.go: deterministic replica addrs from path hash
- qa_promote_replication_test.go: address-upgrade trigger test
- qa_promote_rejoin_live_test.go: new live rejoin test

Testrunner:
- devops.go: action improvements
- recovery-baseline-failover.yaml, suite-ha-failover.yaml: scenario updates
- cp11b3-manual-promote.yaml: promote scenario alignment
- fresh_volume_write_test.go: new component test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
pingqiu
2026-04-05 11:38:05 -07:00
co-authored by Claude Opus 4.6
parent 7855d5240c
commit cf16e53b04
22 changed files with 1204 additions and 82 deletions
@@ -143,6 +143,50 @@ func TestQueue_ConfirmFromHeartbeat_PrunesConfirmed(t *testing.T) {
}
}
func TestQueue_ConfirmFromHeartbeat_SameEpochRefreshWaitsForReplicaTransport(t *testing.T) {
q := NewBlockAssignmentQueue()
initial := mkAssign("/a.blk", 5, 1)
refresh := mkAssign("/a.blk", 5, 1)
refresh.ReplicaAddrs = []blockvol.ReplicaAddr{{
DataAddr: "10.0.0.2:14260",
CtrlAddr: "10.0.0.2:14261",
ServerID: "vs2",
}}
q.Enqueue("s1", initial)
q.Enqueue("s1", refresh)
// Old heartbeat confirms the epoch/role but does not yet report the refreshed
// replica transport, so only the original promote assignment is confirmed.
q.ConfirmFromHeartbeat("s1", []blockvol.BlockVolumeInfoMessage{{
Path: "/a.blk",
Epoch: 5,
}})
got := q.Peek("s1")
if len(got) != 1 {
t.Fatalf("expected refresh assignment to remain pending, got %d: %+v", len(got), got)
}
if got[0].Path != "/a.blk" || got[0].Epoch != 5 {
t.Fatalf("wrong remaining assignment: %+v", got[0])
}
if len(got[0].ReplicaAddrs) != 1 {
t.Fatalf("remaining refresh assignment lost replica addrs: %+v", got[0])
}
// Once the promoted VS reports the refreshed replica transport in heartbeat,
// the same-epoch refresh is confirmed and removed.
q.ConfirmFromHeartbeat("s1", []blockvol.BlockVolumeInfoMessage{{
Path: "/a.blk",
Epoch: 5,
ReplicaDataAddr: "10.0.0.2:14260",
ReplicaCtrlAddr: "10.0.0.2:14261",
}})
if q.Pending("s1") != 0 {
t.Fatalf("expected refresh assignment to be confirmed after transport appears, got %d pending", q.Pending("s1"))
}
}
func TestQueue_PeekPrunesStaleEpochs(t *testing.T) {
q := NewBlockAssignmentQueue()
q.Enqueue("s1", mkAssign("/a.blk", 1, 1)) // stale