From 1d3fb1f119bafb3fd5119a3a1837aa142d1b7348 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Fri, 3 Apr 2026 08:36:00 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20CP13-7=20rev3=20=E2=80=94=20require=20Ne?= =?UTF-8?q?edsRebuild,=20not=20Degraded,=20after=20handshake=20gap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tighten TestReconnect_GapBeyondRetainedWal_NeedsRebuild assertion from "NeedsRebuild or Degraded" to strictly "NeedsRebuild". The handshake R < S path returns NeedsRebuild directly — tolerating Degraded weakened the proof. Co-Authored-By: Claude Opus 4.6 (1M context) --- weed/storage/blockvol/sync_all_protocol_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/storage/blockvol/sync_all_protocol_test.go b/weed/storage/blockvol/sync_all_protocol_test.go index bd2223f71..2f7407f7d 100644 --- a/weed/storage/blockvol/sync_all_protocol_test.go +++ b/weed/storage/blockvol/sync_all_protocol_test.go @@ -401,12 +401,12 @@ func TestReconnect_GapBeyondRetainedWal_NeedsRebuild(t *testing.T) { t.Fatal("SyncCache hung") } - // Verify the NEW shipper detected the gap via handshake (not just budget). + // Verify the NEW shipper reached NeedsRebuild via handshake R < S detection. newS := primary.shipperGroup.Shipper(0) - if newS.State() != ReplicaNeedsRebuild && newS.State() != ReplicaDegraded { - t.Fatalf("new shipper should be NeedsRebuild or Degraded after handshake gap detection, got %s", newS.State()) + if newS.State() != ReplicaNeedsRebuild { + t.Fatalf("CP13-7: expected NeedsRebuild after handshake gap detection (R < S), got %s", newS.State()) } - t.Logf("CP13-7: reconnect handshake detected gap beyond retained WAL (state=%s)", newS.State()) + t.Log("CP13-7: reconnect handshake detected gap beyond retained WAL → NeedsRebuild") } // ---------- WAL retention ----------