2016-03-10 14:18:13 +00:00
|
|
|
#!/bin/sh
|
2016-03-14 14:47:04 +00:00
|
|
|
#
|
|
|
|
# rbd_mirror.sh - test rbd-mirror daemon
|
|
|
|
#
|
|
|
|
# The scripts starts two ("local" and "remote") clusters using mstart.sh script,
|
|
|
|
# creates a temporary directory, used for cluster configs, daemon logs, admin
|
|
|
|
# socket, temporary files, and launches rbd-mirror daemon.
|
|
|
|
#
|
2016-03-10 14:18:13 +00:00
|
|
|
|
2016-06-09 20:23:52 +00:00
|
|
|
if [ -n "${CEPH_REF}" ]; then
|
|
|
|
wget -O rbd_mirror_helpers.sh "https://git.ceph.com/?p=ceph.git;a=blob_plain;hb=$CEPH_REF;f=qa/workunits/rbd/rbd_mirror_helpers.sh"
|
2016-06-11 17:01:31 +00:00
|
|
|
. ./rbd_mirror_helpers.sh
|
2016-06-09 20:23:52 +00:00
|
|
|
else
|
|
|
|
. $(dirname $0)/rbd_mirror_helpers.sh
|
2016-03-10 14:18:13 +00:00
|
|
|
fi
|
|
|
|
|
2016-04-28 06:32:33 +00:00
|
|
|
testlog "TEST: add image and test replay"
|
2016-04-07 23:57:14 +00:00
|
|
|
start_mirror ${CLUSTER1}
|
2016-03-10 14:18:13 +00:00
|
|
|
image=test
|
2016-05-26 16:49:45 +00:00
|
|
|
create_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 100
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
2016-05-18 18:17:13 +00:00
|
|
|
if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
|
2016-05-26 16:49:45 +00:00
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'down+unknown'
|
2016-05-18 18:17:13 +00:00
|
|
|
fi
|
2016-05-26 16:49:45 +00:00
|
|
|
compare_images ${POOL} ${image}
|
2016-03-10 14:18:13 +00:00
|
|
|
|
2016-04-28 06:32:33 +00:00
|
|
|
testlog "TEST: stop mirror, add image, start mirror and test replay"
|
2016-04-07 23:57:14 +00:00
|
|
|
stop_mirror ${CLUSTER1}
|
2016-03-10 14:18:13 +00:00
|
|
|
image1=test1
|
2016-05-26 16:49:45 +00:00
|
|
|
create_image ${CLUSTER2} ${POOL} ${image1}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image1} 100
|
2016-04-07 23:57:14 +00:00
|
|
|
start_mirror ${CLUSTER1}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image1}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image1} 'up+replaying' 'master_position'
|
2016-05-18 18:17:13 +00:00
|
|
|
if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
|
2016-05-26 16:49:45 +00:00
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image1} 'down+unknown'
|
2016-05-18 18:17:13 +00:00
|
|
|
fi
|
2016-05-26 16:49:45 +00:00
|
|
|
compare_images ${POOL} ${image1}
|
2016-03-10 14:18:13 +00:00
|
|
|
|
2016-04-28 06:32:33 +00:00
|
|
|
testlog "TEST: test the first image is replaying after restart"
|
2016-05-26 16:49:45 +00:00
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 100
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
2016-03-28 19:57:58 +00:00
|
|
|
|
2016-04-28 06:32:33 +00:00
|
|
|
testlog "TEST: stop/start/restart mirror via admin socket"
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror restart
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror restart
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
2016-05-27 15:40:58 +00:00
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop ${POOL} ${CLUSTER2}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
2016-05-27 15:40:58 +00:00
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start ${POOL} ${CLUSTER2}
|
2016-07-29 04:58:26 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror restart ${POOL}/${image}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
2016-05-27 15:40:58 +00:00
|
|
|
admin_daemon ${CLUSTER1} rbd mirror restart ${POOL} ${CLUSTER2}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
2016-04-28 06:32:33 +00:00
|
|
|
|
2016-07-29 04:58:26 +00:00
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop ${POOL} ${CLUSTER2}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image1}
|
|
|
|
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror restart ${POOL} ${CLUSTER2}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image1}
|
|
|
|
|
2016-04-28 06:32:33 +00:00
|
|
|
admin_daemon ${CLUSTER1} rbd mirror flush
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror status
|
|
|
|
|
|
|
|
testlog "TEST: failover and failback"
|
2016-04-07 23:57:14 +00:00
|
|
|
start_mirror ${CLUSTER2}
|
2016-03-28 19:57:58 +00:00
|
|
|
|
2016-08-08 14:39:01 +00:00
|
|
|
# demote and promote same cluster
|
|
|
|
demote_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
|
|
|
|
promote_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 100
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
2016-03-28 19:57:58 +00:00
|
|
|
# failover
|
2016-05-26 16:49:45 +00:00
|
|
|
demote_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
|
|
|
|
promote_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER2} ${POOL} ${image}
|
|
|
|
write_image ${CLUSTER1} ${POOL} ${image} 100
|
|
|
|
wait_for_replay_complete ${CLUSTER2} ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+stopped'
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
2016-03-28 19:57:58 +00:00
|
|
|
|
|
|
|
# failback
|
2016-05-26 16:49:45 +00:00
|
|
|
demote_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
|
|
|
|
promote_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 100
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
test_status_in_pool_dir ${CLUSTER2} ${POOL} ${image} 'up+stopped'
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
|
|
|
testlog "TEST: cloned images"
|
|
|
|
parent_image=test_parent
|
|
|
|
parent_snap=snap
|
|
|
|
create_image ${CLUSTER2} ${PARENT_POOL} ${parent_image}
|
|
|
|
write_image ${CLUSTER2} ${PARENT_POOL} ${parent_image} 100
|
2016-06-10 01:14:27 +00:00
|
|
|
create_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
|
|
|
|
protect_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
|
2016-05-26 16:49:45 +00:00
|
|
|
|
|
|
|
clone_image=test_clone
|
|
|
|
clone_image ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap} ${POOL} ${clone_image}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${clone_image} 100
|
|
|
|
|
|
|
|
enable_mirror ${CLUSTER2} ${PARENT_POOL} ${parent_image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${PARENT_POOL} ${parent_image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${PARENT_POOL} ${parent_image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${PARENT_POOL} ${parent_image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${PARENT_POOL} ${parent_image}
|
|
|
|
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${clone_image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${clone_image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${clone_image}
|
2016-03-10 14:18:13 +00:00
|
|
|
|
2016-07-04 10:54:32 +00:00
|
|
|
expect_failure "is non-primary" clone_image ${CLUSTER1} ${PARENT_POOL} \
|
|
|
|
${parent_image} ${parent_snap} ${POOL} ${clone_image}1
|
|
|
|
|
2016-05-13 15:47:25 +00:00
|
|
|
testlog "TEST: disable mirroring / delete non-primary image"
|
2016-06-10 01:14:27 +00:00
|
|
|
image2=test2
|
|
|
|
image3=test3
|
|
|
|
image4=test4
|
|
|
|
image5=test5
|
|
|
|
for i in ${image2} ${image3} ${image4} ${image5}; do
|
|
|
|
create_image ${CLUSTER2} ${POOL} ${i}
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${i} 100
|
|
|
|
create_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
|
|
|
|
create_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
|
|
|
|
if [ "${i}" = "${image4}" ] || [ "${i}" = "${image5}" ]; then
|
|
|
|
protect_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
|
|
|
|
protect_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
|
|
|
|
fi
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${i} 100
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'present'
|
|
|
|
wait_for_snap_present ${CLUSTER1} ${POOL} ${i} 'snap2'
|
|
|
|
done
|
|
|
|
|
2016-05-26 16:49:45 +00:00
|
|
|
set_pool_mirror_mode ${CLUSTER2} ${POOL} 'image'
|
2016-06-10 01:14:27 +00:00
|
|
|
for i in ${image2} ${image4}; do
|
|
|
|
disable_mirror ${CLUSTER2} ${POOL} ${i}
|
|
|
|
done
|
|
|
|
|
|
|
|
unprotect_snapshot ${CLUSTER2} ${POOL} ${image5} 'snap1'
|
|
|
|
unprotect_snapshot ${CLUSTER2} ${POOL} ${image5} 'snap2'
|
|
|
|
for i in ${image3} ${image5}; do
|
|
|
|
remove_snapshot ${CLUSTER2} ${POOL} ${i} 'snap1'
|
|
|
|
remove_snapshot ${CLUSTER2} ${POOL} ${i} 'snap2'
|
2016-07-06 09:59:25 +00:00
|
|
|
# workaround #16555: before removing make sure it is not still bootstrapped
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${i}
|
2016-06-10 01:14:27 +00:00
|
|
|
remove_image ${CLUSTER2} ${POOL} ${i}
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in ${image2} ${image3} ${image4} ${image5}; do
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'deleted'
|
|
|
|
done
|
|
|
|
|
2016-05-26 16:49:45 +00:00
|
|
|
set_pool_mirror_mode ${CLUSTER2} ${POOL} 'pool'
|
2016-06-10 01:14:27 +00:00
|
|
|
for i in ${image2} ${image4}; do
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${i} 'present'
|
|
|
|
wait_for_snap_present ${CLUSTER1} ${POOL} ${i} 'snap2'
|
2016-06-13 04:19:37 +00:00
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${i}
|
2016-06-10 01:14:27 +00:00
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${i}
|
|
|
|
compare_images ${POOL} ${i}
|
|
|
|
done
|
2016-05-13 15:47:25 +00:00
|
|
|
|
2016-07-08 02:16:51 +00:00
|
|
|
testlog "TEST: snapshot rename"
|
|
|
|
snap_name='snap_rename'
|
|
|
|
create_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_0"
|
|
|
|
for i in `seq 1 20`; do
|
|
|
|
rename_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_$(expr ${i} - 1)" "${snap_name}_${i}"
|
|
|
|
done
|
|
|
|
wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}"
|
|
|
|
|
2016-05-13 15:47:25 +00:00
|
|
|
testlog "TEST: disable mirror while daemon is stopped"
|
|
|
|
stop_mirror ${CLUSTER1}
|
|
|
|
stop_mirror ${CLUSTER2}
|
2016-05-26 16:49:45 +00:00
|
|
|
set_pool_mirror_mode ${CLUSTER2} ${POOL} 'image'
|
|
|
|
disable_mirror ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test_image_present ${CLUSTER1} ${POOL} ${image} 'present'
|
2016-05-13 15:47:25 +00:00
|
|
|
start_mirror ${CLUSTER1}
|
2016-05-26 16:49:45 +00:00
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
set_pool_mirror_mode ${CLUSTER2} ${POOL} 'pool'
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'present'
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
2016-05-13 15:47:25 +00:00
|
|
|
|
2016-05-19 11:06:08 +00:00
|
|
|
testlog "TEST: simple image resync"
|
|
|
|
request_resync_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
|
|
|
testlog "TEST: image resync while replayer is stopped"
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop ${POOL}/${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
request_resync_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
|
|
|
testlog "TEST: request image resync while daemon is offline"
|
|
|
|
stop_mirror ${CLUSTER1}
|
|
|
|
request_resync_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
start_mirror ${CLUSTER1}
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'master_position'
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
2016-07-27 10:45:32 +00:00
|
|
|
testlog "TEST: client disconnect"
|
|
|
|
image=laggy
|
|
|
|
create_image ${CLUSTER2} ${POOL} ${image} 128 --journal-object-size 64K
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 10
|
|
|
|
|
|
|
|
testlog " - replay stopped after disconnect"
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
disconnect_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
|
|
|
|
|
|
|
|
testlog " - replay started after resync requested"
|
|
|
|
request_resync_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
|
|
|
testlog " - disconnected after max_concurrent_object_sets reached"
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror stop ${POOL}/${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
set_image_meta ${CLUSTER2} ${POOL} ${image} \
|
|
|
|
conf_rbd_journal_max_concurrent_object_sets 1
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 20 16384
|
|
|
|
write_image ${CLUSTER2} ${POOL} ${image} 20 16384
|
|
|
|
test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
set_image_meta ${CLUSTER2} ${POOL} ${image} \
|
|
|
|
conf_rbd_journal_max_concurrent_object_sets 0
|
|
|
|
|
|
|
|
testlog " - replay is still stopped (disconnected) after restart"
|
|
|
|
admin_daemon ${CLUSTER1} rbd mirror start ${POOL}/${image}
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
|
|
|
|
|
|
|
|
testlog " - replay started after resync requested"
|
|
|
|
request_resync_image ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
|
2016-08-10 10:46:46 +00:00
|
|
|
testlog " - rbd_mirroring_resync_after_disconnect config option"
|
|
|
|
set_image_meta ${CLUSTER1} ${POOL} ${image} \
|
|
|
|
conf_rbd_mirroring_resync_after_disconnect true
|
|
|
|
disconnect_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
|
|
|
|
wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
|
|
|
|
wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -n "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
compare_images ${POOL} ${image}
|
|
|
|
set_image_meta ${CLUSTER1} ${POOL} ${image} \
|
|
|
|
conf_rbd_mirroring_resync_after_disconnect false
|
|
|
|
disconnect_image ${CLUSTER2} ${POOL} ${image}
|
|
|
|
test -z "$(get_mirror_position ${CLUSTER2} ${POOL} ${image})"
|
|
|
|
wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
|
|
|
|
test_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
|
|
|
|
|
2016-03-10 14:18:13 +00:00
|
|
|
echo OK
|