#define CEPH_LIBRBD_MIRROR_DISABLE_REQUEST_H
#include "include/buffer.h"
-#include "common/Mutex.h"
+#include "common/ceph_mutex.h"
#include "cls/journal/cls_journal_types.h"
#include "cls/rbd/cls_rbd_types.h"
+#include "librbd/mirror/Types.h"
+
#include <map>
#include <string>
* <start>
* |
* v
- * GET_MIRROR_IMAGE * * * * * * * * * * * * * * * * * * * * * * *
- * | *
- * v *
- * GET_TAG_OWNER * * * * * * * * * * * * * * * * * * * * * * * *
+ * GET_MIRROR_INFO * * * * * * * * * * * * * * * * * * * * * * *
* | *
* v *
- * SET_MIRROR_IMAGE * * * * * * * * * * * * * * * * * * * * * * *
+ * IMAGE_STATE_UPDATE * * * * * * * * * * * * * * * * * * * * * *
* | *
* v *
- * NOTIFY_MIRRORING_WATCHER *
+ * PROMOTE_IMAGE (skip if primary) *
* | *
* v *
- * PROMOTE_IMAGE (skip if primary) *
+ * REFRESH_IMAGE (skip if necessary) *
* | *
* v *
* GET_CLIENTS <----------------------------------------\ * * * *
* REMOVE_MIRROR_IMAGE * * * * * * * * * * * * * * * * * * * * *
* | (skip if no remove) *
* v *
- * NOTIFY_MIRRORING_WATCHER_REMOVED *
- * | (skip if not primary or no remove) *
- * v *
* <finish> < * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* @endverbatim
Context *m_on_finish;
bool m_is_primary = false;
- bufferlist m_out_bl;
cls::rbd::MirrorImage m_mirror_image;
+ PromotionState m_promotion_state = PROMOTION_STATE_NON_PRIMARY;
+ std::string m_primary_mirror_uuid;
std::set<cls::journal::Client> m_clients;
std::map<std::string, int> m_ret;
std::map<std::string, int> m_current_ops;
int m_error_result = 0;
- mutable Mutex m_lock;
-
- void send_get_mirror_image();
- Context *handle_get_mirror_image(int *result);
+ mutable ceph::mutex m_lock =
+ ceph::make_mutex("mirror::DisableRequest::m_lock");
- void send_get_tag_owner();
- Context *handle_get_tag_owner(int *result);
+ void send_get_mirror_info();
+ Context *handle_get_mirror_info(int *result);
- void send_set_mirror_image();
- Context *handle_set_mirror_image(int *result);
+ void send_image_state_update();
+ Context *handle_image_state_update(int *result);
void send_notify_mirroring_watcher();
Context *handle_notify_mirroring_watcher(int *result);
void send_promote_image();
Context *handle_promote_image(int *result);
+ void send_refresh_image();
+ Context* handle_refresh_image(int* result);
+
+ void clean_mirror_state();
+
void send_get_clients();
Context *handle_get_clients(int *result);
+ void remove_mirror_snapshots();
+
void send_remove_snap(const std::string &client_id,
const cls::rbd::SnapshotNamespace &snap_namespace,
const std::string &snap_name);