From c974574f8a8908570f7e7cb97dd6955a21febb0b Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 30 Nov 2026 22:14:22 -0800 Subject: [PATCH] test: the rejoin failure reports both replicas' log tails The primary's peer answer alone cannot tell a replica that never caught up from one that never answered; the failure now carries r2's and r3's logs. Co-Authored-By: Claude Opus 5.5 --- .../cmd/blockvolume/fence_heal_integration_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/fence_heal_integration_test.go b/seaweed-block/cmd/blockvolume/fence_heal_integration_test.go index c285e9bc05..cbbe480621 100644 --- a/seaweed-block/cmd/blockvolume/fence_heal_integration_test.go +++ b/seaweed-block/cmd/blockvolume/fence_heal_integration_test.go @@ -191,7 +191,9 @@ func fencingRoundHeal(t *testing.T, rejoin bool) { // not ready, and the gate then fences once more and continues r1 at the // next epoch, which is the designed answer to a primary that is not // ready, not a failure of the rejoin. - epoch := waitRejoinConverged(t, r1.status, 2, "r2", "r3") + epoch := waitRejoinConverged(t, r1.status, 2, func() string { + return "r2 log tail:\n" + r2.d.tail(40) + "\nr3 log tail:\n" + r3.d.tail(40) + }, "r2", "r3") if epoch > 2 { t.Logf("a further fencing round continued r1 at epoch %d after the pause", epoch) } @@ -210,7 +212,10 @@ func fencingRoundHeal(t *testing.T, rejoin bool) { // peer at that same e, all read in one pass; it returns e. Reading the epoch // once and then waiting for that exact epoch would fail if a further round // moved it in between. -func waitRejoinConverged(t *testing.T, statusAddr string, minEpoch uint64, rids ...string) uint64 { +// On failure it reports the last answer and dump(), the replicas' own logs: +// the primary's answer alone cannot tell a replica that never caught up from +// one that never answered. +func waitRejoinConverged(t *testing.T, statusAddr string, minEpoch uint64, dump func() string, rids ...string) uint64 { t.Helper() c := &http.Client{Timeout: 5 * time.Second} get := func(path string) []byte { @@ -256,7 +261,7 @@ func waitRejoinConverged(t *testing.T, statusAddr string, minEpoch uint64, rids return st.Epoch } } - t.Fatalf("the primary and %v never converged on one epoch >= %d; last answer: %s", rids, minEpoch, last) + t.Fatalf("the primary and %v never converged on one epoch >= %d; last answer: %s\n%s", rids, minEpoch, last, dump()) return 0 }