diff options
author | Jason Dillaman <dillaman@redhat.com> | 2020-03-20 15:54:43 +0100 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2020-03-20 18:18:14 +0100 |
commit | 336a16bcaf0f23bd63dbac4d6797c801a6a0773d (patch) | |
tree | f36a10de1918b65aead19ab97f00aaad4bf8eb2a | |
parent | librbd: request exclusive lock when moving to trash (diff) | |
download | ceph-336a16bcaf0f23bd63dbac4d6797c801a6a0773d.tar.xz ceph-336a16bcaf0f23bd63dbac4d6797c801a6a0773d.zip |
rbd-mirror: snapshot sync request needs to check for interruption
If the sync request was locally canceled, we need to resume the paused
shut down logic instead of just notifying the image replayer state
machine of the change -- since it had already requested a shut down and
will not re-request it.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
-rw-r--r-- | src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index 4cc2d1b78f9..69fb3d93af4 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -763,17 +763,21 @@ template <typename I> void Replayer<I>::handle_request_sync(int r) { dout(10) << "r=" << r << dendl; - if (r == -ECANCELED) { + std::unique_lock locker{m_lock}; + if (is_replay_interrupted(&locker)) { + return; + } else if (r == -ECANCELED) { dout(5) << "image-sync canceled" << dendl; - handle_replay_complete(r, "image-sync canceled"); + handle_replay_complete(&locker, r, "image-sync canceled"); return; } else if (r < 0) { derr << "failed to request image-sync: " << cpp_strerror(r) << dendl; - handle_replay_complete(r, "failed to request image-sync"); + handle_replay_complete(&locker, r, "failed to request image-sync"); return; } m_sync_in_progress = true; + locker.unlock(); copy_image(); } |