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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-11-22 18:02:52 +05:30 committed by mergify[bot]
parent 211ca9b5a7
commit 027b68ab39

View File

@ -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()) 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()) interval, startTime := getSchedulingDetails(req.GetParameters())
if interval != admin.NoInterval { if interval != admin.NoInterval {
err = rbdVol.addSnapshotScheduling(interval, startTime) err = rbdVol.addSnapshotScheduling(interval, startTime)
@ -543,6 +537,12 @@ func (rs *ReplicationServer) PromoteVolume(ctx context.Context,
rbdVol) 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 return &replication.PromoteVolumeResponse{}, nil
} }