wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group}" 'up+replaying' 0
count_omap_keys_with_filter "${secondary_cluster}" "${pool}" "rbd_mirror_leader" "image_map" key_count
- test "${key_count}" = 2 || fail "unexpected key count:${key_count}"
+ test "${key_count}" = 1 || fail "unexpected key count:${key_count}"
elif [ "${scenario}" = 'stop_restart_after_recreate' ]; then
echo "stopping daemon on secondary"
stop_mirrors "${secondary_cluster}"
wait_for_group_status_in_pool_dir "${secondary_cluster}" "${pool}"/"${group}" 'up+replaying' 0
count_omap_keys_with_filter "${secondary_cluster}" "${pool}" "rbd_mirror_leader" "image_map" key_count
- test "${key_count}" = 2 || fail "unexpected key count:${key_count}"
+ test "${key_count}" = 1 || fail "unexpected key count:${key_count}"
fi
mirror_group_disable "${primary_cluster}" "${pool}/${group}"
for (auto &entity : entities) {
auto global_id = GlobalId(entity.type, entity.global_id);
auto result = m_peer_map[global_id].insert(mirror_uuid);
- if ((result.second && m_peer_map[global_id].size() == 1) || entity.type == MIRROR_ENTITY_TYPE_GROUP) {
+ if ((result.second && m_peer_map[global_id].size() == 1)) {
if (m_policy->add_entity(global_id, entity.count)) {
schedule_action(global_id);
}
#include "librbd/internal.h"
#include "librbd/group/ListSnapshotsRequest.h"
#include "librbd/group/RemoveImageRequest.h"
+#include "librbd/MirroringWatcher.h"
#include "librbd/Utils.h"
#include "tools/rbd_mirror/ImageReplayer.h"
#include "tools/rbd_mirror/PoolMetaCache.h"
return;
}
- finish(0);
+ notify_mirroring_watcher();
}
template <typename I>
return;
}
+ notify_mirroring_watcher();
+}
+
+template <typename I>
+void BootstrapRequest<I>::notify_mirroring_watcher() {
+ dout(10) << dendl;
+
+ auto ctx = create_context_callback<
+ BootstrapRequest<I>,
+ &BootstrapRequest<I>::handle_notify_mirroring_watcher>(this);
+
+ librbd::MirroringWatcher<I>::notify_group_updated(
+ m_local_io_ctx, m_local_mirror_group.state, *m_local_group_id,
+ m_global_group_id, m_local_images.size(), ctx);
+}
+
+template <typename I>
+void BootstrapRequest<I>::handle_notify_mirroring_watcher(int r) {
+ dout(10) << "r=" << r << dendl;
+
+ if (r < 0) {
+ derr << "failed to notify mirror group update: " << cpp_strerror(r)
+ << dendl;
+ }
+
finish(0);
}
void create_local_non_primary_group_snapshot();
void handle_create_local_non_primary_group_snapshot(int r);
+ void notify_mirroring_watcher();
+ void handle_notify_mirroring_watcher(int r);
+
void finish(int r);
int create_replayers();