Skip to content

Commit

Permalink
Merge pull request ceph#43228 from idryomov/wip-rbd-mirror-snapshot-r…
Browse files Browse the repository at this point in the history
…x-only

rbd-mirror: unbreak one-way snapshot-based mirroring

Reviewed-by: Mykola Golub <[email protected]>
  • Loading branch information
idryomov authored Sep 25, 2021
2 parents 803e03d + 366e9c5 commit 75824a1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ tasks:
CEPH_ARGS: ''
RBD_MIRROR_INSTANCES: '1'
RBD_MIRROR_USE_EXISTING_CLUSTER: '1'
MIRROR_POOL_MODE: 'pool'
MIRROR_IMAGE_MODE: 'journal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
meta:
- desc: run the rbd_mirror_bootstrap.sh workunit to test the rbd-mirror daemon
tasks:
- workunit:
clients:
cluster1.client.mirror: [rbd/rbd_mirror_bootstrap.sh]
env:
# override workunit setting of CEPH_ARGS='--cluster'
CEPH_ARGS: ''
RBD_MIRROR_INSTANCES: '1'
RBD_MIRROR_USE_EXISTING_CLUSTER: '1'
MIRROR_POOL_MODE: 'image'
MIRROR_IMAGE_MODE: 'snapshot'
2 changes: 1 addition & 1 deletion qa/workunits/rbd/rbd_mirror_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ testlog "TEST: verify rx-only direction"
[ "$(rbd --cluster ${CLUSTER1} --pool ${POOL} mirror pool info --format xml |
${XMLSTARLET} sel -t -v '//mirror/peers/peer[1]/uuid')" = "" ]

create_image ${CLUSTER1} ${POOL} image1
create_image_and_enable_mirror ${CLUSTER1} ${POOL} image1

wait_for_image_replay_started ${CLUSTER2} ${POOL} image1
write_image ${CLUSTER1} ${POOL} image1 100
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/RemotePoolPoller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rbd_mirror
#undef dout_prefix
#define dout_prefix *_dout << "rbd::mirror::RemotePollPoller: " << this << " " \
#define dout_prefix *_dout << "rbd::mirror::RemotePoolPoller: " << this << " " \
<< __func__ << ": "

namespace rbd {
Expand Down Expand Up @@ -183,7 +183,7 @@ void RemotePoolPoller<I>::handle_mirror_peer_list(int r) {

cls::rbd::MirrorPeer* matched_peer = nullptr;
for (auto& peer : peers) {
if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_TX) {
if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_RX) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd_mirror/Types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::ostream& operator<<(std::ostream& lhs,
std::ostream& operator<<(std::ostream& lhs,
const RemotePoolMeta& rhs) {
return lhs << "mirror_uuid=" << rhs.mirror_uuid << ", "
"mirror_pool_uuid=" << rhs.mirror_peer_uuid;
"mirror_peer_uuid=" << rhs.mirror_peer_uuid;
}

std::ostream& operator<<(std::ostream& lhs, const PeerSpec &peer) {
Expand Down

0 comments on commit 75824a1

Please sign in to comment.