diff options
Diffstat (limited to 'src/tools/rbd_mirror/ImageReplayer.h')
-rw-r--r-- | src/tools/rbd_mirror/ImageReplayer.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/tools/rbd_mirror/ImageReplayer.h b/src/tools/rbd_mirror/ImageReplayer.h index 79a744d9842..72f03f77b6c 100644 --- a/src/tools/rbd_mirror/ImageReplayer.h +++ b/src/tools/rbd_mirror/ImageReplayer.h @@ -4,11 +4,6 @@ #ifndef CEPH_RBD_MIRROR_IMAGE_REPLAYER_H #define CEPH_RBD_MIRROR_IMAGE_REPLAYER_H -#include <map> -#include <string> -#include <vector> - -#include "include/atomic.h" #include "common/AsyncOpTracker.h" #include "common/Mutex.h" #include "common/WorkQueue.h" @@ -23,10 +18,16 @@ #include "ImageDeleter.h" #include "ProgressContext.h" #include "types.h" -#include <set> + #include <boost/noncopyable.hpp> #include <boost/optional.hpp> +#include <set> +#include <map> +#include <atomic> +#include <string> +#include <vector> + class AdminSocketHook; namespace journal { @@ -109,7 +110,8 @@ public: const std::string &remote_image_id, librados::IoCtx &remote_io_ctx); void remove_remote_image(const std::string &remote_mirror_uuid, - const std::string &remote_image_id); + const std::string &remote_image_id, + bool schedule_delete); bool remote_images_empty() const; inline int64_t get_local_pool_id() const { @@ -118,10 +120,6 @@ public: inline const std::string& get_global_image_id() const { return m_global_image_id; } - inline std::string get_local_image_id() { - Mutex::Locker locker(m_lock); - return m_local_image_id; - } void start(Context *on_finish = nullptr, bool manual = false); void stop(Context *on_finish = nullptr, bool manual = false, @@ -146,6 +144,9 @@ protected: * <starting> * * | * * v (error) * + * PREPARE_LOCAL_IMAGE * * * * * * * * * * * * * * * * * * + * | * + * v (error) * * BOOTSTRAP_IMAGE * * * * * * * * * * * * * * * * * * * * * | * * v (error) * @@ -304,6 +305,7 @@ private: nullptr; librados::IoCtx m_local_ioctx; ImageCtxT *m_local_image_ctx = nullptr; + std::string m_local_image_tag_owner; decltype(ImageCtxT::journal) m_local_journal = nullptr; librbd::journal::Replay<ImageCtxT> *m_local_replay = nullptr; @@ -388,6 +390,9 @@ private: void handle_shut_down(int r); void handle_remote_journal_metadata_updated(); + void prepare_local_image(); + void handle_prepare_local_image(int r); + void bootstrap(); void handle_bootstrap(int r); |