]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: skip setting error code on snapshot replayer shutdown 47914/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 30 Aug 2022 09:45:44 +0000 (11:45 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 1 Sep 2022 18:24:12 +0000 (20:24 +0200)
commitddd83fa96467d91379faaa510d656c4962110772
treedad46ef170373c16ea171218147118c4a3f20bce
parent9a4030e36cca053d874aca0c3354241375476999
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>
(cherry picked from commit ced071f0de57af8cddffebca24baeb27f2a211d8)
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc