From fb3f7fe202b4356cbc22b4f3dcf794debbbd4f27 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 18 Mar 2021 13:00:57 +0530 Subject: [PATCH] rbd: remove todo for image not found Incase of resync the image will get deleted, gets recreated and its a a time consuming operation. It makes sense to return aborted error instead of not found as we have omap data only the image is missing in rbd pool. Signed-off-by: Madhu Rajanna --- internal/rbd/replicationcontrollerserver.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/rbd/replicationcontrollerserver.go b/internal/rbd/replicationcontrollerserver.go index c68d88baf..71fc0cf44 100644 --- a/internal/rbd/replicationcontrollerserver.go +++ b/internal/rbd/replicationcontrollerserver.go @@ -405,11 +405,10 @@ func (rs *ReplicationServer) ResyncVolume(ctx context.Context, mirroringInfo, err := rbdVol.getImageMirroringInfo() if err != nil { - // TODO: check if the image is not found return valid error message // in case of Resync the image will get deleted and gets recreated and - // it takes time for this operation + // it takes time for this operation. util.ErrorLog(ctx, err.Error()) - return nil, status.Error(codes.Internal, err.Error()) + return nil, status.Error(codes.Aborted, err.Error()) } if mirroringInfo.State != librbd.MirrorImageEnabled {