mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: prevent calling mirror.Resync() if the mirror is syncing
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
04257464bb
commit
af4431f60b
@ -718,7 +718,13 @@ func (rs *ReplicationServer) ResyncVolume(ctx context.Context,
|
||||
return nil, status.Errorf(codes.Internal, "failed to parse image creation time: %s", sErr.Error())
|
||||
}
|
||||
log.DebugLog(ctx, "image %s, savedImageTime=%v, currentImageTime=%v", rbdVol, st, creationTime)
|
||||
if req.GetForce() && st.Equal(*creationTime) {
|
||||
|
||||
syncInfo, sErr := localStatus.GetLastSyncInfo(ctx)
|
||||
if sErr != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to get last sync info: %s", sErr.Error())
|
||||
}
|
||||
|
||||
if req.GetForce() && st.Equal(*creationTime) && !syncInfo.IsSyncing() {
|
||||
err = mirror.Resync(ctx)
|
||||
if err != nil {
|
||||
return nil, getGRPCError(err)
|
||||
|
Reference in New Issue
Block a user