From 0e67c8da2440e9c8bb187281e5bba0afdd6e93b6 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 28 Jun 2022 16:17:02 +0530 Subject: [PATCH] rbd: fix checkHealthyPrimary to consider up+stopped state we need to check for image should be in up+stopped state not anyone of the state for that the we need to use OR check not the AND check. Signed-off-by: Madhu Rajanna (cherry picked from commit 53e76fab692750bb74e630ab25bb7052b366b420) --- internal/rbd/replicationcontrollerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rbd/replicationcontrollerserver.go b/internal/rbd/replicationcontrollerserver.go index cc036b6fc..a767ef44f 100644 --- a/internal/rbd/replicationcontrollerserver.go +++ b/internal/rbd/replicationcontrollerserver.go @@ -632,7 +632,7 @@ func checkHealthyPrimary(ctx context.Context, rbdVol *rbdVolume) error { return fmt.Errorf("failed to get local status: %w", err) } - if !localStatus.Up && localStatus.State != librbd.MirrorImageStatusStateStopped { + if !localStatus.Up || localStatus.State != librbd.MirrorImageStatusStateStopped { return fmt.Errorf("%s %w. State is up=%t, state=%q", rbdVol, ErrUnHealthyMirroredImage,