]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd-mirror: skip setting error code on snapshot replayer shutdown
authorIlya Dryomov <idryomov@gmail.com>
Tue, 30 Aug 2022 09:45:44 +0000 (11:45 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 30 Aug 2022 10:01:35 +0000 (12:01 +0200)
commitced071f0de57af8cddffebca24baeb27f2a211d8
tree6cc02259a1739d130b7dd7e01f1db5dc06e23c9d
parentfc4cc575bc53f62f88ee3faf0daba8906bc1c6c1
rbd-mirror: skip setting error code on snapshot replayer shutdown

This is regarding failures in unregister_remote_update_watcher() and
unregister_local_update_watcher().  handle_replay_complete() can't be
called in these cases anymore as it would blindly attempt to unregister
watchers from scratch again.  Dropping handle_replay_complete() calls
there means that these failures would only be logged and would not be
surfaced by snapshot replayer.  But the only caller ignores them
anyway:

  void ImageReplayer<I>::shut_down(int r) {
    ...
    // close the replayer
    if (m_replayer != nullptr) {
      ctx = new LambdaContext([this, ctx](int r) {
        m_replayer->destroy();
        m_replayer = nullptr;
        ctx->complete(0);             <------
      });
      ctx = new LambdaContext([this, ctx](int r) {
        m_replayer->shut_down(ctx);
      });
    }

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc