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 }