]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #35348 from dillaman/wip-45714
authorMykola Golub <mgolub@suse.com>
Thu, 4 Jun 2020 10:57:01 +0000 (13:57 +0300)
committerGitHub <noreply@github.com>
Thu, 4 Jun 2020 10:57:01 +0000 (13:57 +0300)
rbd-mirror: stop local journal replayer first during shut down

Reviewed-by: Mykola Golub <mgolub@suse.com>
1  2 
src/tools/rbd_mirror/image_replayer/journal/Replayer.cc
src/tools/rbd_mirror/image_replayer/journal/Replayer.h

index 616ac4d1dcbc2c3a0772cddaa121ef263ef970eb,3af886fdf3abd9f21acac3676746509e7dd67b30..60b9a7e59319ad6399adcceb675348aff519375c
@@@ -869,14 -854,15 +893,16 @@@ void Replayer<I>::handle_replay_flush_s
  
  template <typename I>
  void Replayer<I>::handle_replay_flush(int r) {
 +  std::unique_lock locker{m_lock};
    dout(10) << "r=" << r << dendl;
+   m_flush_tracker.finish_op();
    if (r < 0) {
      derr << "replay flush encountered an error: " << cpp_strerror(r) << dendl;
 -    handle_replay_complete(r, "replay flush encountered an error");
 +    handle_replay_complete(locker, r, "replay flush encountered an error");
      m_event_replay_tracker.finish_op();
      return;
 -  } else if (is_replay_complete()) {
 +  } else if (is_replay_complete(locker)) {
      m_event_replay_tracker.finish_op();
      return;
    }
index f650b48b0ab131ddc5d7ff1a55108cfbffeaf56e,b279aa9a297e19308cb2bfef72f04cb96313ad78..6b1f36d9c7fe9d9f699667fb1e13d1a6041aba78
@@@ -235,13 -240,14 +240,16 @@@ private
    void init_remote_journaler();
    void handle_init_remote_journaler(int r);
  
 -  void start_external_replay();
 +  void start_external_replay(std::unique_lock<ceph::mutex>& locker);
    void handle_start_external_replay(int r);
  
 +  bool add_local_journal_listener(std::unique_lock<ceph::mutex>& locker);
 +
    bool notify_init_complete(std::unique_lock<ceph::mutex>& locker);
  
+   void wait_for_flush();
+   void handle_wait_for_flush(int r);
    void shut_down_local_journal_replay();
    void handle_shut_down_local_journal_replay(int r);