From f47921f29397257f77c946eef7ba4346bf6481a4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 31 Aug 2018 10:52:04 -0500 Subject: [PATCH] qa/standalone/osd/osd-backfill-stats: fixes 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 --- qa/standalone/osd/osd-backfill-stats.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qa/standalone/osd/osd-backfill-stats.sh b/qa/standalone/osd/osd-backfill-stats.sh index 7999028412388..7631029eeaae2 100755 --- a/qa/standalone/osd/osd-backfill-stats.sh +++ b/qa/standalone/osd/osd-backfill-stats.sh @@ -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 -- 2.39.5