summaryrefslogtreecommitdiffstats
path: root/qa
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2019-12-05 19:59:31 +0100
committerSage Weil <sage@redhat.com>2019-12-05 21:31:24 +0100
commit66690ea3143ac5097f7c7f3118f2d00fed30cc4b (patch)
tree8cb5b7527adcbdb0fd28263ddd4a2e3f0ba9f4c3 /qa
parentMerge PR #31955 into master (diff)
downloadceph-66690ea3143ac5097f7c7f3118f2d00fed30cc4b.tar.xz
ceph-66690ea3143ac5097f7c7f3118f2d00fed30cc4b.zip
mgr/DaemonServer: fix 'osd ok-to-stop' for EC pools
We need to pay attention to account for CRUSH_ITEM_NONE entries in the EC PG acting set. Fixes: https://tracker.ceph.com/issues/43151 Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'qa')
-rwxr-xr-xqa/standalone/misc/ok-to-stop.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/qa/standalone/misc/ok-to-stop.sh b/qa/standalone/misc/ok-to-stop.sh
index e53b28d1eb2..5e4a4180d9c 100755
--- a/qa/standalone/misc/ok-to-stop.sh
+++ b/qa/standalone/misc/ok-to-stop.sh
@@ -237,5 +237,53 @@ function TEST_0_mds() {
kill_daemons $dir KILL mds.a
}
+function TEST_0_osd() {
+ local dir=$1
+
+ CEPH_ARGS="$ORIG_CEPH_ARGS --mon-host=$CEPH_MON_A "
+
+ run_mon $dir a --public-addr=$CEPH_MON_A || return 1
+ run_mgr $dir x || return 1
+ run_osd $dir 0 || return 1
+ run_osd $dir 1 || return 1
+ run_osd $dir 2 || return 1
+ run_osd $dir 3 || return 1
+
+ ceph osd erasure-code-profile set ec-profile m=2 k=2 crush-failure-domain=osd || return 1
+ ceph osd pool create ec erasure ec-profile || return 1
+
+ wait_for_clean || return 1
+
+ # with min_size 3, we can stop only 1 osd
+ ceph osd pool set ec min_size 3 || return 1
+ flush_pg_stats || return 1
+
+ ceph osd ok-to-stop 0 || return 1
+ ceph osd ok-to-stop 1 || return 1
+ ceph osd ok-to-stop 2 || return 1
+ ceph osd ok-to-stop 3 || return 1
+ ! ceph osd ok-to-stop 0 1 || return 1
+ ! ceph osd ok-to-stop 2 3 || return 1
+
+ # with min_size 2 we can stop 1 osds
+ ceph osd pool set ec min_size 2 || return 1
+ flush_pg_stats || return 1
+
+ ceph osd ok-to-stop 0 1 || return 1
+ ceph osd ok-to-stop 2 3 || return 1
+ ! ceph osd ok-to-stop 0 1 2 || return 1
+ ! ceph osd ok-to-stop 1 2 3 || return 1
+
+ # we should get the same result with one of the osds already down
+ kill_daemons $dir TERM osd.0 || return 1
+ ceph osd down 0 || return 1
+ flush_pg_stats || return 1
+
+ ceph osd ok-to-stop 0 || return 1
+ ceph osd ok-to-stop 0 1 || return 1
+ ! ceph osd ok-to-stop 0 1 2 || return 1
+ ! ceph osd ok-to-stop 1 2 3 || return 1
+}
+
main ok-to-stop "$@"