]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/standalone/osd/osd-backfill-stats: fixes
authorSage Weil <sage@redhat.com>
Fri, 31 Aug 2018 15:52:04 +0000 (10:52 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 22:11:18 +0000 (17:11 -0500)
Grep from the primary's log, not every osd's log.

For the backfill_remapped task in particular, after the pg_temp change it
just so happens that the primary changes across the pool size change and
thus two different primaries do (some) backfill.  Fix that test to pass
the correct primary.

Other tests are unaffected as they do not (happen to) trigger a primary
change and already satisfied the (removed) check that only one OSD does
backfill.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/standalone/osd/osd-backfill-stats.sh

index 7999028412388b4c42e321985f12c1102ec5ecdc..7631029eeaae207e6513d43a4b1eea2842f0e161 100755 (executable)
@@ -71,7 +71,7 @@ function check() {
     local primary_start=${9:-}
     local primary_end=${10:-}
 
-    local log=$(grep -l +backfilling $dir/osd.*.log)
+    local log=$(grep -l +backfilling $dir/osd.$primary.log)
     test -n "$log" || return 1
     if [ "$(echo "$log" | wc -w)" != "1" ];
     then
@@ -458,15 +458,21 @@ function TEST_backfill_remapped() {
     ceph osd out osd.${primary}
     ceph osd pool set $poolname size 2
     sleep 2
+
+    # primary may change due to invalidating the old pg_temp, which was [1,2,0],
+    # but up_primary (3) chooses [0,1] for acting.
+    local new_primary=$(get_primary $poolname obj1)
+
     ceph osd unset nobackfill
     ceph tell osd.$(get_primary $poolname obj1) debug kick_recovery_wq 0
+
     sleep 2
 
     wait_for_clean || return 1
 
     local misplaced=$(expr $objects \* 2)
 
-    check $dir $PG $primary replicated 0 0 $misplaced $objects || return 1
+    check $dir $PG $new_primary replicated 0 0 $misplaced $objects || return 1
 
     delete_pool $poolname
     kill_daemons $dir || return 1