From: David Zafman Date: Wed, 15 Jun 2016 03:09:15 +0000 (-0700) Subject: test: Handle object removals in a non-racey way X-Git-Tag: v10.2.7~24^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=026f181e72f2e09e769a8821dfe2c99f6213e6a3;p=ceph.git test: Handle object removals in a non-racey way Signed-off-by: David Zafman (cherry picked from commit bfe3ebd94fdc1ef36ebe6e8f9d38acea322eca22) --- diff --git a/src/test/osd/osd-scrub-repair.sh b/src/test/osd/osd-scrub-repair.sh index 037c427456c2..cd53dfc8b34c 100755 --- a/src/test/osd/osd-scrub-repair.sh +++ b/src/test/osd/osd-scrub-repair.sh @@ -313,27 +313,35 @@ function TEST_list_missing_erasure_coded() { # Put an object and remove the two shards (including primary) add_something $dir $poolname MOBJ0 || return 1 - local -a osds=($(get_osds $poolname MOBJ0)) - - pids="" - run_in_background pids objectstore_tool $dir ${osds[0]} MOBJ0 remove - run_in_background pids objectstore_tool $dir ${osds[1]} MOBJ0 remove - wait_background pids - return_code=$? - if [ $return_code -ne 0 ]; then return $return_code; fi - + local -a osds0=($(get_osds $poolname MOBJ0)) # Put another object and remove two shards (excluding primary) add_something $dir $poolname MOBJ1 || return 1 - local -a osds=($(get_osds $poolname MOBJ1)) + local -a osds1=($(get_osds $poolname MOBJ1)) - pids="" - run_in_background pids objectstore_tool $dir ${osds[1]} MOBJ1 remove - run_in_background pids objectstore_tool $dir ${osds[2]} MOBJ1 remove - wait_background pids - return_code=$? - if [ $return_code -ne 0 ]; then return $return_code; fi + # Stop all osd daemons + for id in $(seq 0 2) ; do + kill_daemons $dir TERM osd.$id >&2 < /dev/null || return 1 + done + id=${osds0[0]} + ceph-objectstore-tool --data-path $dir/$id --journal-path $dir/$id/journal \ + MOBJ0 remove || return 1 + id=${osds0[1]} + ceph-objectstore-tool --data-path $dir/$id --journal-path $dir/$id/journal \ + MOBJ0 remove || return 1 + + id=${osds1[1]} + ceph-objectstore-tool --data-path $dir/$id --journal-path $dir/$id/journal \ + MOBJ1 remove || return 1 + id=${osds1[2]} + ceph-objectstore-tool --data-path $dir/$id --journal-path $dir/$id/journal \ + MOBJ1 remove || return 1 + + for id in $(seq 0 2) ; do + activate_osd $dir $id >&2 || return 1 + done + wait_for_clean >&2 # Get get - both objects should in the same PG local pg=$(get_pg $poolname MOBJ0)