From a7655954bef28d5fd87edad91f2e417fcd25e648 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 6 May 2026 02:36:22 -0700 Subject: [PATCH] iscsi: report idle replica path as alua standby --- seaweed-block/cmd/blockvolume/iscsi_alua_provider.go | 7 ++++++- seaweed-block/cmd/blockvolume/iscsi_alua_provider_test.go | 2 +- seaweed-block/scripts/run-iscsi-alua-multipath-smoke.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/seaweed-block/cmd/blockvolume/iscsi_alua_provider.go b/seaweed-block/cmd/blockvolume/iscsi_alua_provider.go index 7cc7e81c7b..5f8fcf1ece 100644 --- a/seaweed-block/cmd/blockvolume/iscsi_alua_provider.go +++ b/seaweed-block/cmd/blockvolume/iscsi_alua_provider.go @@ -43,7 +43,12 @@ func (p *projectionALUAProvider) ALUAState() iscsi.ALUAState { return iscsi.ALUATransitioning case engine.ModeHealthy: return iscsi.ALUAStandby - case engine.ModeDegraded, engine.ModeIdle: + case engine.ModeIdle: + // Supporting replicas can remain engine-idle while still serving + // ALUA/VPD path probes through the metadata probe backend. They are + // standby paths, not frontend-write-ready paths. + return iscsi.ALUAStandby + case engine.ModeDegraded: return iscsi.ALUAUnavailable default: return iscsi.ALUATransitioning diff --git a/seaweed-block/cmd/blockvolume/iscsi_alua_provider_test.go b/seaweed-block/cmd/blockvolume/iscsi_alua_provider_test.go index 74a22ea3c3..3abb2ff89d 100644 --- a/seaweed-block/cmd/blockvolume/iscsi_alua_provider_test.go +++ b/seaweed-block/cmd/blockvolume/iscsi_alua_provider_test.go @@ -29,7 +29,7 @@ func TestProjectionALUAProvider_StateMapping(t *testing.T) { {name: "superseded healthy", mode: engine.ModeHealthy, superseded: true, want: iscsi.ALUAStandby}, {name: "recovering", mode: engine.ModeRecovering, want: iscsi.ALUATransitioning}, {name: "degraded", mode: engine.ModeDegraded, want: iscsi.ALUAUnavailable}, - {name: "idle", mode: engine.ModeIdle, want: iscsi.ALUAUnavailable}, + {name: "idle", mode: engine.ModeIdle, want: iscsi.ALUAStandby}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/seaweed-block/scripts/run-iscsi-alua-multipath-smoke.sh b/seaweed-block/scripts/run-iscsi-alua-multipath-smoke.sh index 6ca1e5d66b..c50c675541 100755 --- a/seaweed-block/scripts/run-iscsi-alua-multipath-smoke.sh +++ b/seaweed-block/scripts/run-iscsi-alua-multipath-smoke.sh @@ -272,7 +272,7 @@ sleep 2 sudo multipath -ll >"$ARTIFACT_DIR/multipath.ll.txt" 2>&1 || true if ! awk -v a="$base1" -v b="$base2" ' - /^[^[:space:]]/ { + /^[[:alnum:]_.:-]+[[:space:]]+\(/ { if (seen && hasA && hasB) { print map found=1