]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: update asok hook name on image rename
authorMykola Golub <mgolub@mirantis.com>
Fri, 11 Aug 2017 12:27:41 +0000 (14:27 +0200)
committerVasu Kulkarni <vasu@redhat.com>
Mon, 19 Feb 2018 23:59:16 +0000 (15:59 -0800)
Fixes: http://tracker.ceph.com/issues/20860
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 9ddb5da3377029d11cb1089102d7146e9ee2537a)

qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh
src/tools/rbd_mirror/ImageReplayer.cc

index 04a03a66e5cfc82bed406a43f7ecd48199ecb7b0..5195e6cf3e91ea85d3bf47b384a3e8c206015c6f 100755 (executable)
@@ -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}
 
index 23216711e6ac3c86f49e082c74b2a88e133fbffe..325353b91bc7e87b4520e45ce33d6a3da1ce53d2 100755 (executable)
@@ -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
index a84199968a253657c44be60dc252ba242bfa6a3d..d003a9b8d83fde4f217364f92201dac276c925b3 100644 (file)
@@ -1272,6 +1272,8 @@ void ImageReplayer<I>::handle_process_entry_ready(int r) {
   dout(20) << dendl;
   assert(r == 0);
 
+  on_name_changed();
+
   // attempt to process the next event
   handle_replay_ready();
 }