Skip to content

Commit

Permalink
Merge branch 'wip-10409-removed-object' of git://github.com/dachary/ceph
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Dec 22, 2014
2 parents 20a4c57 + 6f8aad0 commit 2bfcf74
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions src/test/osd/osd-scrub-repair.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,31 +91,39 @@ function corrupt_and_repair_one() {
objectstore_tool $dir $osd SOMETHING list-attrs || return 1
rados --pool $poolname get SOMETHING $dir/COPY || return 1
diff $dir/ORIGINAL $dir/COPY || return 1

wait_for_clean || return 1
}

function TEST_corrupt_and_repair_erasure_coded() {
local dir=$1
local poolname=ecpool
local payload=ABCDEF

setup $dir || return 1
run_mon $dir a || return 1
run_osd $dir 0 || return 1
run_osd $dir 1 || return 1
run_osd $dir 2 || return 1
run_osd $dir 3 || return 1
wait_for_clean || return 1

ceph osd set noscrub || return 1
ceph osd set nodeep-scrub || return 1
ceph osd erasure-code-profile set myprofile \
k=2 m=2 ruleset-failure-domain=osd || return 1
ceph osd pool create $poolname 1 1 erasure myprofile \
|| return 1

local payload=ABCDEF
echo $payload > $dir/ORIGINAL
#
# 1) add an object
#
rados --pool $poolname put SOMETHING $dir/ORIGINAL || return 1
#
# 2) remove the corresponding file from the OSD
#
objectstore_tool $dir $osd SOMETHING remove || return 1
#
# 3) repair the PG
#
local pg=$(get_pg $poolname SOMETHING)
repair $pg
#
# The file must be back
#
objectstore_tool $dir $osd SOMETHING list-attrs || return 1
add_something $dir $poolname

local primary=$(get_primary $poolname SOMETHING)
local -a osds=($(get_osds $poolname SOMETHING | sed -e "s/$primary//"))
local not_primary_first=${osds[0]}
local not_primary_second=${osds[1]}

# Reproduces http://tracker.ceph.com/issues/10409
corrupt_and_repair_one $dir $poolname $not_primary_first || return 1

teardown $dir || return 1
}

main osd-scrub-repair "$@"
Expand Down

0 comments on commit 2bfcf74

Please sign in to comment.