diff --git a/qa/standalone/osd/osd-rep-recov-eio.sh b/qa/standalone/osd/osd-rep-recov-eio.sh index 3a478566320..e286a79b32a 100755 --- a/qa/standalone/osd/osd-rep-recov-eio.sh +++ b/qa/standalone/osd/osd-rep-recov-eio.sh @@ -292,6 +292,54 @@ function TEST_rep_recovery_unfound() { delete_pool $poolname } +# This is a filestore only test because it requires data digest in object info +function TEST_rep_read_unfound() { + local dir=$1 + local objname=myobject + + setup_osds 3 || return 1 + + ceph osd pool delete rbd rbd --yes-i-really-really-mean-it || return 1 + local poolname=test-pool + create_pool $poolname 1 1 || return 1 + ceph osd pool set $poolname size 2 + wait_for_clean || return 1 + + ceph pg dump pgs + + dd if=/dev/urandom bs=8k count=1 of=$dir/ORIGINAL + rados -p $poolname put $objname $dir/ORIGINAL + + local primary=$(get_primary $poolname $objname) + local other=$(get_not_primary $poolname $objname) + + dd if=/dev/urandom bs=8k count=1 of=$dir/CORRUPT + objectstore_tool $dir $primary $objname set-bytes $dir/CORRUPT || return 1 + objectstore_tool $dir $other $objname set-bytes $dir/CORRUPT || return 1 + + timeout 30 rados -p $poolname get $objname $dir/tmp & + + sleep 5 + + ceph --format=json pg dump pgs | jq '.' + + if ! ceph --format=json pg dump pgs | jq '.[0].state' | grep -q recovery_unfound + then + echo "Failure to get to recovery_unfound state" + return 1 + fi + + objectstore_tool $dir $other $objname set-bytes $dir/ORIGINAL || return 1 + + wait + + if ! cmp $dir/ORIGINAL $dir/tmp + then + echo "Bad data after primary repair" + return 1 + fi +} + main osd-rep-recov-eio.sh "$@" # Local Variables: