iscsi: report idle replica path as alua standby

This commit is contained in:
pingqiu committed 2026-05-06 02:36:22 -07:00
1 parent 6eff9a0cb2
commit a7655954be
3 files changed
+8 -3

No files matched your search

@@ -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
@@ -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) {
@@ -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