]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerDavid Zafman <dzafman@redhat.com>
Thu, 7 Feb 2019 22:50:56 +0000 (14:50 -0800)
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>
(cherry picked from commit f47921f29397257f77c946eef7ba4346bf6481a4)

qa/standalone/osd/osd-backfill-stats.sh

index d57305f4e5b117e3a00ab40e1c87701695b514cd..5e1d90162ad5be0fc7e57aecae2f0e049d5cd112 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
 
     local addp=" "
@@ -453,15 +453,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