From f8f592fce69bcc8cb80cb4522f5da68b7d30d1f4 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Wed, 6 Nov 2024 08:05:21 +0800 Subject: [PATCH] fix: undefined e.ReplicaAddressMap longhorn/longhorn-9244 Signed-off-by: Chin-Ya Huang --- pkg/spdk/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/spdk/engine.go b/pkg/spdk/engine.go index 3d357d59..c309cd2f 100644 --- a/pkg/spdk/engine.go +++ b/pkg/spdk/engine.go @@ -1897,12 +1897,12 @@ func (e *Engine) waitForRestoreComplete() error { var err error for range periodicChecker.C { isReplicaRestoreCompleted := true - for replicaName, replicaAddress := range e.ReplicaAddressMap { - if e.ReplicaModeMap[replicaName] != types.ModeRW { + for replicaName, replicaStatus := range e.ReplicaStatusMap { + if replicaStatus.Mode != types.ModeRW { continue } - isReplicaRestoreCompleted, err = e.isReplicaRestoreCompleted(replicaName, replicaAddress) + isReplicaRestoreCompleted, err = e.isReplicaRestoreCompleted(replicaName, replicaStatus.Address) if err != nil { return errors.Wrapf(err, "failed to check replica %s restore status", replicaName) }