]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: osd-pool-create test EAGAIN when pending
authorLoic Dachary <loic@dachary.org>
Mon, 3 Feb 2014 21:59:30 +0000 (22:59 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 4 Feb 2014 07:16:23 +0000 (08:16 +0100)
Test that if the ruleset is found in the pending paxos proposal, the
pool creation will try again.

Reviewed-By: Christophe Courtaut <christophe.courtaut@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/mon/osd-pool-create.sh

index 24f7d18f7609746f3cd86e238920d77a04a605f1..98e25e8155645dac610c28a87aaaf6e31e44e797 100755 (executable)
@@ -17,6 +17,9 @@
 set -xe
 PS4='$LINENO: '
 
+# must be larger than the time it takes for osd pool create to perform
+# on the slowest http://ceph.com/gitbuilder.cgi machine
+TIMEOUT=${TIMEOUT:-30}
 DIR=osd-pool-create
 rm -fr $DIR
 trap "test \$? = 0 || cat $DIR/log ; set +x ; kill_mon || true && rm -fr $DIR" EXIT
@@ -97,6 +100,15 @@ grep 'EINVAL' $DIR/out
 ./ceph --format json osd dump | grep '"crush_ruleset":1'
 kill_mon
 
+# try again if the ruleset creation is pending
+run_mon --paxos-propose-interval=200 --debug-mon=20 --debug-paxos=20 
+crush_ruleset=erasure_ruleset
+./ceph osd crush rule create-erasure nevermind # the first modification ignores the propose interval, get past it
+! timeout $TIMEOUT ./ceph osd crush rule create-erasure $crush_ruleset || exit 1
+! timeout $TIMEOUT ./ceph osd pool create pool_erasure 12 12 erasure crush_ruleset=$crush_ruleset
+grep "$crush_ruleset try again" $DIR/log
+kill_mon
+
 expected='"foo":"bar"'
 # osd_pool_default_erasure_code_properties is JSON
 run_mon --osd_pool_default_erasure_code_properties "{$expected}"
@@ -137,5 +149,5 @@ grep "erasure-code-directory" $DIR/osd.json > /dev/null
 kill_mon
 
 # Local Variables:
-# compile-command: "cd ../.. ; make TESTS=test/mon/osd-pool-create.sh check"
+# compile-command: "cd ../.. ; make -j4 && TIMEOUT=1 test/mon/osd-pool-create.sh"
 # End: