From 027b68ab391fe23e09ab13637c3f595868a6e7c4 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 22 Nov 2021 18:02:52 +0530 Subject: [PATCH] rbd: operate on dummy image after adding scheduling currently we are fist operating on the dummy image to refresh the pool and then we are adding the scheduling. we think the scheduling should be added first and than we should refresh the pool. If we do this all the existing schedules will be considered from the scheduler. Signed-off-by: Madhu Rajanna --- internal/rbd/replicationcontrollerserver.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/rbd/replicationcontrollerserver.go b/internal/rbd/replicationcontrollerserver.go index bd5d4d58e..7d6659abc 100644 --- a/internal/rbd/replicationcontrollerserver.go +++ b/internal/rbd/replicationcontrollerserver.go @@ -523,12 +523,6 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context, return nil, status.Errorf(codes.Internal, "failed to get mirroring mode %s", err.Error()) } - log.DebugLog(ctx, "Attempting to tickle dummy image for restarting RBD schedules") - err = tickleMirroringOnDummyImage(rbdVol, mode) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to enable mirroring on dummy image %s", err.Error()) - } - interval, startTime := getSchedulingDetails(req.GetParameters()) if interval != admin.NoInterval { err = rbdVol.addSnapshotScheduling(interval, startTime) @@ -543,6 +537,12 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context, rbdVol) } + log.DebugLog(ctx, "attempting to tickle dummy image for restarting RBD schedules") + err = tickleMirroringOnDummyImage(rbdVol, mode) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to enable mirroring on dummy image %s", err.Error()) + } + return &replication.PromoteVolumeResponse{}, nil }