File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -790,23 +790,25 @@ function TEST_abort_periodic_for_operator() {
790790 (( extr_dbg >= 2 )) && ceph tell osd.2 dump_scrub_reservations --format=json-pretty
791791
792792 # the first PG to work with:
793- local pg1=" 1.0"
794- # and another one, that shares its primary, and at least one more active set member
795793 local pg2=" "
796- for pg in " ${! pg_pr[@]} " ; do
797- if [[ " ${pg_pr[$pg]} " == " ${pg_pr[$pg1]} " ]]; then
798- local -i common=0
799- count_common_active $pg $pg1 pg_ac common
800- if [[ $common -gt 1 ]]; then
801- pg2=$pg
802- break
794+ for pg1 in " ${! pg_pr[@]} " ; do
795+ for pg in " ${! pg_pr[@]} " ; do
796+ if [[ " $pg " == " $pg1 " ]]; then
797+ continue
803798 fi
804- fi
799+ if [[ " ${pg_pr[$pg]} " == " ${pg_pr[$pg1]} " ]]; then
800+ local -i common=$( count_common_active $pg $pg1 pg_ac)
801+ if [[ $common -gt 1 ]]; then
802+ pg2=$pg
803+ break 2
804+ fi
805+ fi
806+ done
805807 done
808+
806809 if [[ -z " $pg2 " ]]; then
807- # \todo handle the case when no such PG is found
808810 echo " No PG found with the same primary as $pg1 "
809- return 1
811+ return 0 # not an error
810812 fi
811813
812814 # the common primary is allowed two concurrent scrubs
Original file line number Diff line number Diff line change @@ -367,7 +367,6 @@ function count_common_active {
367367 local pg1=$1
368368 local pg2=$2
369369 local -n pg_acting_dict=$3
370- local -n res=$4
371370
372371 local -a a1=(${pg_acting_dict[$pg1]} )
373372 local -a a2=(${pg_acting_dict[$pg2]} )
@@ -381,7 +380,7 @@ function count_common_active {
381380 done
382381 done
383382
384- res= $cnt
383+ printf ' %d ' " $cnt "
385384}
386385
387386
@@ -398,8 +397,7 @@ function find_disjoint_but_primary {
398397
399398 for cand in " ${! ac_dict[@]} " ; do
400399 if [[ " $cand " != " $pg " ]]; then
401- local -i common=0
402- count_common_active " $pg " " $cand " ac_dict common
400+ local -i common=$( count_common_active " $pg " " $cand " ac_dict)
403401 if [[ $common -eq 0 || ( $common -eq 1 && " ${p_dict[$pg]} " == " ${p_dict[$cand]} " )]]; then
404402 res=$cand
405403 return
You can’t perform that action at this time.
0 commit comments