]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: osd-crush.sh must retry crush dump 12016/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 16 Nov 2016 09:18:02 +0000 (10:18 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 16 Nov 2016 09:21:26 +0000 (10:21 +0100)
After ceph osd setcrushmap, the script must retry because ceph osd crush
dump races against the update of the crushmap.

Fixes: http://tracker.ceph.com/issues/17919
Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/mon/osd-crush.sh

index 4fecd4a4d516a3901f8957b71c49ace8a29ef827..982ec904b25f8cbe207010824670e718554817e2 100755 (executable)
@@ -271,8 +271,19 @@ function TEST_crush_repair_faulty_crushmap() {
     ceph osd setcrushmap -i $empty_map.map || return 1
 
     # should be an empty crush map without any buckets
-    ! test $(ceph osd crush dump --format=xml | \
-           $XMLSTARLET sel -t -m "//buckets/bucket" -v .) || return 1
+    success=false
+    for delay in 1 2 4 8 16 32 64 128 256 ; do
+        if ! test $(ceph osd crush dump --format=xml | \
+                           $XMLSTARLET sel -t -m "//buckets/bucket" -v .) ; then
+            success=true
+            break
+        fi
+        sleep $delay
+    done
+    if ! $success ; then
+        ceph osd crush dump --format=xml
+        return 1
+    fi
     # bring them down, the "ceph" commands will try to hunt for other monitor in
     # vain, after mon.a is offline
     kill_daemons $dir || return 1