From e8758a57262ee67ec2b06102e96ff5e4f518ce47 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 2 Feb 2021 15:28:48 -0500 Subject: [PATCH] qa/suites/rbd: add snapshot-based mirroring stress test Signed-off-by: Jason Dillaman (cherry picked from commit 094bfeaf8efe1c4794a2b301314eddedfa5246f9) --- ...> rbd-mirror-journal-stress-workunit.yaml} | 2 ++ ...apshot-stress-workunit-exclusive-lock.yaml | 16 +++++++++++ ...or-snapshot-stress-workunit-fast-diff.yaml | 16 +++++++++++ ...rror-snapshot-stress-workunit-minimum.yaml | 16 +++++++++++ qa/workunits/rbd/rbd_mirror_helpers.sh | 7 ++++- qa/workunits/rbd/rbd_mirror_stress.sh | 28 +++++++++++++++++-- 6 files changed, 82 insertions(+), 3 deletions(-) rename qa/suites/rbd/mirror-thrash/workloads/{rbd-mirror-stress-workunit.yaml => rbd-mirror-journal-stress-workunit.yaml} (85%) create mode 100644 qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-exclusive-lock.yaml create mode 100644 qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-fast-diff.yaml create mode 100644 qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-minimum.yaml diff --git a/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-stress-workunit.yaml b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-journal-stress-workunit.yaml similarity index 85% rename from qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-stress-workunit.yaml rename to qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-journal-stress-workunit.yaml index 62bda88173b5e..9579b70d62c0c 100644 --- a/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-stress-workunit.yaml +++ b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-journal-stress-workunit.yaml @@ -10,4 +10,6 @@ tasks: RBD_MIRROR_INSTANCES: '4' RBD_MIRROR_USE_EXISTING_CLUSTER: '1' RBD_MIRROR_USE_RBD_MIRROR: '1' + MIRROR_POOL_MODE: 'pool' + MIRROR_IMAGE_MODE: 'journal' timeout: 6h diff --git a/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-exclusive-lock.yaml b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-exclusive-lock.yaml new file mode 100644 index 0000000000000..87632483d1cbb --- /dev/null +++ b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-exclusive-lock.yaml @@ -0,0 +1,16 @@ +meta: +- desc: run the rbd_mirror_stress.sh workunit to test the rbd-mirror daemon +tasks: +- workunit: + clients: + cluster1.client.mirror: [rbd/rbd_mirror_stress.sh] + env: + # override workunit setting of CEPH_ARGS='--cluster' + CEPH_ARGS: '' + MIRROR_POOL_MODE: 'image' + MIRROR_IMAGE_MODE: 'snapshot' + RBD_IMAGE_FEATURES: 'layering,exclusive-lock' + RBD_MIRROR_INSTANCES: '4' + RBD_MIRROR_USE_EXISTING_CLUSTER: '1' + RBD_MIRROR_USE_RBD_MIRROR: '1' + timeout: 6h diff --git a/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-fast-diff.yaml b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-fast-diff.yaml new file mode 100644 index 0000000000000..fc43b0ec24d76 --- /dev/null +++ b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-fast-diff.yaml @@ -0,0 +1,16 @@ +meta: +- desc: run the rbd_mirror_stress.sh workunit to test the rbd-mirror daemon +tasks: +- workunit: + clients: + cluster1.client.mirror: [rbd/rbd_mirror_stress.sh] + env: + # override workunit setting of CEPH_ARGS='--cluster' + CEPH_ARGS: '' + MIRROR_POOL_MODE: 'image' + MIRROR_IMAGE_MODE: 'snapshot' + RBD_IMAGE_FEATURES: 'layering,exclusive-lock,object-map,fast-diff' + RBD_MIRROR_INSTANCES: '4' + RBD_MIRROR_USE_EXISTING_CLUSTER: '1' + RBD_MIRROR_USE_RBD_MIRROR: '1' + timeout: 6h diff --git a/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-minimum.yaml b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-minimum.yaml new file mode 100644 index 0000000000000..af0ea12408bdc --- /dev/null +++ b/qa/suites/rbd/mirror-thrash/workloads/rbd-mirror-snapshot-stress-workunit-minimum.yaml @@ -0,0 +1,16 @@ +meta: +- desc: run the rbd_mirror_stress.sh workunit to test the rbd-mirror daemon +tasks: +- workunit: + clients: + cluster1.client.mirror: [rbd/rbd_mirror_stress.sh] + env: + # override workunit setting of CEPH_ARGS='--cluster' + CEPH_ARGS: '' + MIRROR_POOL_MODE: 'image' + MIRROR_IMAGE_MODE: 'snapshot' + RBD_IMAGE_FEATURES: 'layering' + RBD_MIRROR_INSTANCES: '4' + RBD_MIRROR_USE_EXISTING_CLUSTER: '1' + RBD_MIRROR_USE_RBD_MIRROR: '1' + timeout: 6h diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 5a214689d2444..3e26f977cd83a 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -542,6 +542,9 @@ status() echo "image ${image} journal status" rbd --cluster ${cluster} -p ${image_pool} --namespace "${image_ns}" journal status --image ${image} echo + echo "image ${image} snapshots" + rbd --cluster ${cluster} -p ${image_pool} --namespace "${image_ns}" snap ls --all ${image} + echo done echo "${cluster} ${image_pool} ${image_ns} rbd_mirroring omap vals" @@ -902,7 +905,9 @@ create_image_and_enable_mirror() fi create_image ${cluster} ${pool} ${image} $@ - enable_mirror ${cluster} ${pool} ${image} ${mode} + if [ "${MIRROR_POOL_MODE}" = "image" ] || [ "$pool" = "${PARENT_POOL}" ]; then + enable_mirror ${cluster} ${pool} ${image} ${mode} + fi } enable_journaling() diff --git a/qa/workunits/rbd/rbd_mirror_stress.sh b/qa/workunits/rbd/rbd_mirror_stress.sh index cb4f66b256c4f..5125d0ed6e7dd 100755 --- a/qa/workunits/rbd/rbd_mirror_stress.sh +++ b/qa/workunits/rbd/rbd_mirror_stress.sh @@ -90,9 +90,10 @@ start_mirrors ${CLUSTER2} testlog "TEST: add image and test replay after client crashes" image=test -create_image ${CLUSTER2} ${POOL} ${image} '512M' +create_image_and_enable_mirror ${CLUSTER2} ${POOL} ${image} ${MIRROR_IMAGE_MODE} '512M' wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} +clean_snap_name= for i in `seq 1 10` do stress_write_image ${CLUSTER2} ${POOL} ${image} @@ -104,12 +105,35 @@ do wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image} wait_for_snap_present ${CLUSTER1} ${POOL} ${image} ${snap_name} + + if [ -n "${clean_snap_name}" ]; then + compare_image_snaps ${POOL} ${image} ${clean_snap_name} + fi compare_image_snaps ${POOL} ${image} ${snap_name} + + clean_snap_name="snap${i}-clean" + create_snap ${CLUSTER2} ${POOL} ${image} ${clean_snap_name} done +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} +wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image} +wait_for_snap_present ${CLUSTER1} ${POOL} ${image} ${clean_snap_name} + for i in `seq 1 10` do snap_name="snap${i}" + compare_image_snaps ${POOL} ${image} ${snap_name} + + snap_name="snap${i}-clean" + compare_image_snaps ${POOL} ${image} ${snap_name} +done + +for i in `seq 1 10` +do + snap_name="snap${i}" + remove_snapshot ${CLUSTER2} ${POOL} ${image} ${snap_name} + + snap_name="snap${i}-clean" remove_snapshot ${CLUSTER2} ${POOL} ${image} ${snap_name} done @@ -121,7 +145,7 @@ snap_name="snap" for i in `seq 1 ${IMAGE_COUNT}` do image="image_${i}" - create_image ${CLUSTER2} ${POOL} ${image} '128M' + create_image_and_enable_mirror ${CLUSTER2} ${POOL} ${image} ${MIRROR_IMAGE_MODE} '128M' if [ -n "${RBD_MIRROR_REDUCE_WRITES}" ]; then write_image ${CLUSTER2} ${POOL} ${image} 100 else -- 2.39.5