]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: get_rand_pg_acting_set needs to wait for pool to create PGs 64016/head
authorBill Scales <bill_scales@uk.ibm.com>
Wed, 18 Jun 2025 14:06:50 +0000 (15:06 +0100)
committerBill Scales <bill_scales@uk.ibm.com>
Wed, 18 Jun 2025 14:06:50 +0000 (15:06 +0100)
There is a race hazard in the OSD thrasher which tests if a pool
exists and then queries the PGs in the pool. It is possible that
a pool exists (has been added to OSDMap) but the PGs have not
been created yet (by the OSDs). Add a sleep/retry to mitigate
the race.

Fixes: https://tracker.ceph.com/issues/70818
Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
qa/tasks/ceph_manager.py

index de86b188f556f29ea428d174130f8fd29ae443a6..0f7e92c5c2fb98af3c1dacbc43656e7fe53545e1 100644 (file)
@@ -950,7 +950,13 @@ class OSDThrasher(Thrasher):
         have the option to specify which pool you
         want the PG from.
         """
-        pgs = self.ceph_manager.get_pg_stats()
+        with safe_while(sleep=5, tries=3, action="get_pg_stats") as proceed:
+            while proceed():
+                pgs = self.ceph_manager.get_pg_stats()
+                if pgs:
+                    break
+                # If pool has just been created it might not have PGs yet
+                self.log('No pgs; trying again')
         if not pgs:
             self.log('No pgs; doing nothing')
             return