From: Mykola Golub Date: Fri, 11 Aug 2017 12:27:41 +0000 (+0200) Subject: rbd-mirror: update asok hook name on image rename X-Git-Tag: v13.0.1~1010^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ddb5da3377029d11cb1089102d7146e9ee2537a;p=ceph.git rbd-mirror: update asok hook name on image rename Fixes: http://tracker.ceph.com/issues/20860 Signed-off-by: Mykola Golub --- diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index 04a03a66e5c..5195e6cf3e9 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -111,6 +111,18 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' admin_daemon ${CLUSTER1} rbd mirror flush admin_daemon ${CLUSTER1} rbd mirror status +testlog "TEST: test image rename" +new_name="${image}_RENAMED" +rename_image ${CLUSTER2} ${POOL} ${image} ${new_name} +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${new_name} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${new_name} 'up+replaying' +admin_daemon ${CLUSTER1} rbd mirror status ${POOL}/${new_name} +admin_daemon ${CLUSTER1} rbd mirror restart ${POOL}/${new_name} +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${new_name} +wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${new_name} 'up+replaying' +rename_image ${CLUSTER2} ${POOL} ${new_name} ${image} +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} + testlog "TEST: failover and failback" start_mirror ${CLUSTER2} diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 23216711e6a..325353b91bc 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -593,6 +593,16 @@ set_image_meta() rbd --cluster ${cluster} -p ${pool} image-meta set ${image} $key $val } +rename_image() +{ + local cluster=$1 + local pool=$2 + local image=$3 + local new_name=$4 + + rbd --cluster=${cluster} -p ${pool} rename ${image} ${new_name} +} + remove_image() { local cluster=$1 diff --git a/src/tools/rbd_mirror/ImageReplayer.cc b/src/tools/rbd_mirror/ImageReplayer.cc index 65114ee5a19..8569035647d 100644 --- a/src/tools/rbd_mirror/ImageReplayer.cc +++ b/src/tools/rbd_mirror/ImageReplayer.cc @@ -1235,6 +1235,8 @@ void ImageReplayer::handle_process_entry_ready(int r) { dout(20) << dendl; assert(r == 0); + on_name_changed(); + // attempt to process the next event handle_replay_ready(); }