]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephtool/test.sh: make mds epoch check more tolerant 5840/head
authorSage Weil <sage@redhat.com>
Sat, 12 Sep 2015 17:51:13 +0000 (13:51 -0400)
committerSage Weil <sage@redhat.com>
Sat, 12 Sep 2015 17:51:13 +0000 (13:51 -0400)
This can race with an actual mdsmap epoch update for some other
reason.  We just need to make sure the epoch *increased*, not that
it is exactly old + 1.

Fixes: #12991
Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/cephtool/test.sh

index 1ba1efee73583cbf7d9a38b94b45ad1adf1b1ef6..9ca1727d4e7932091a3440cd4048a60f5768bd0d 100755 (executable)
@@ -748,8 +748,15 @@ function test_mon_mds()
   mdsmapfile=$TMPDIR/mdsmap.$$
   current_epoch=$(ceph mds getmap -o $mdsmapfile --no-log-to-stderr 2>&1 | grep epoch | sed 's/.*epoch //')
   [ -s $mdsmapfile ]
+  # make several attempts in case we race with another mdsmap update
   ((epoch = current_epoch + 1))
-  ceph mds setmap -i $mdsmapfile $epoch
+  ((epoch2 = current_epoch + 2))
+  ((epoch3 = current_epoch + 3))
+  ((epoch4 = current_epoch + 4))
+  ceph mds setmap -i $mdsmapfile $epoch || \
+      ceph mds setmap -i $mdsmapfile $epoch2 || \
+      ceph mds setmap -i $mdsmapfile $epoch3 || \
+      ceph mds setmap -i $mdsmapfile $epoch4
   rm $mdsmapfile
 
   ceph osd pool create data2 10