From: Loic Dachary Date: Thu, 4 Dec 2014 11:15:30 +0000 (+0100) Subject: erasure-code: test repair when file is removed X-Git-Tag: v0.92~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c528d87a5f136c6343b6afbb764148bc13d7f5cd;p=ceph.git erasure-code: test repair when file is removed Add tests for when files disappear from the file system : * file is missing from the primary OSD * file is missing from an OSD that is not the primary * files are missing from two OSDs that are not the primary * files are missing from two OSDs, one of which is the primary http://tracker.ceph.com/issues/10017 Refs: #10017 Signed-off-by: Loic Dachary --- diff --git a/src/test/osd/osd-scrub-repair.sh b/src/test/osd/osd-scrub-repair.sh index 1170b1535704..90c51c047153 100755 --- a/src/test/osd/osd-scrub-repair.sh +++ b/src/test/osd/osd-scrub-repair.sh @@ -120,15 +120,44 @@ function TEST_corrupt_and_repair_erasure_coded() { local not_primary_first=${osds[0]} local not_primary_second=${osds[1]} + # Reproduces http://tracker.ceph.com/issues/10017 + corrupt_and_repair_one $dir $poolname $primary || return 1 # Reproduces http://tracker.ceph.com/issues/10409 corrupt_and_repair_one $dir $poolname $not_primary_first || return 1 + corrupt_and_repair_two $dir $poolname $not_primary_first $not_primary_second || return 1 + corrupt_and_repair_two $dir $poolname $primary $not_primary_first || return 1 teardown $dir || return 1 } +function corrupt_and_repair_two() { + local dir=$1 + local poolname=$2 + local first=$3 + local second=$4 + + # + # 1) remove the corresponding file from the OSDs + # + objectstore_tool $dir $first SOMETHING remove || return 1 + objectstore_tool $dir $second SOMETHING remove || return 1 + # + # 2) repair the PG + # + local pg=$(get_pg $poolname SOMETHING) + repair $pg + # + # 3) The files must be back + # + objectstore_tool $dir $first SOMETHING list-attrs || return 1 + objectstore_tool $dir $second SOMETHING list-attrs || return 1 + rados --pool $poolname get SOMETHING $dir/COPY || return 1 + diff $dir/ORIGINAL $dir/COPY || return 1 +} + main osd-scrub-repair "$@" # Local Variables: # compile-command: "cd ../.. ; make -j4 && \ -# test/osd/osd-scrub-repair.sh # TEST_corrupt_and_repair_primary_replicated" +# test/osd/osd-scrub-repair.sh # TEST_corrupt_and_repair_replicated" # End: