]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/ceph: stop any split/merge activity before scrubbing
authorSage Weil <sage@redhat.com>
Sat, 12 Jan 2019 11:32:54 +0000 (05:32 -0600)
committerSage Weil <sage@redhat.com>
Mon, 14 Jan 2019 12:51:21 +0000 (06:51 -0600)
If there are leftover merges at the end of the run they can take a long
time to get through, blowing our timeout for (waiting for pgs to become
active and to stop splitting/merge) and scrubbing pgs.  Stop all of that
at the end of the run so that we don't have to wait so long.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph.py
qa/tasks/ceph_manager.py

index 00c5ba2ae5b44678ca85eb322db3b0c9e0a887a2..a86224f3c62f026ffb12786092eb2cbc59729080 100644 (file)
@@ -1932,6 +1932,10 @@ def task(ctx, config):
 
             yield
         finally:
+            # set pg_num_targets back to actual pg_num, so we don't have to
+            # wait for pending merges (which can take a while!)
+            ctx.managers[config['cluster']].stop_pg_num_changes()
+
             if config.get('wait-for-scrub', True):
                 osd_scrub_pgs(ctx, config)
 
index 73143b8f6382f416477d47fed44e6a6199a5a365..f4cbbf6e08d2d94f2277304aeab4c3f49a8c4d09 100644 (file)
@@ -1796,6 +1796,21 @@ class CephManager:
             self.pools[pool_name] = new_pg_num
             return True
 
+    def stop_pg_num_changes(self):
+        """
+        Reset all pg_num_targets back to pg_num, canceling splits and merges
+        """
+        self.log('Canceling any pending splits or merges...')
+        osd_dump = self.get_osd_dump_json()
+        for pool in osd_dump['pools']:
+            if pool['pg_num'] != pool['pg_num_target']:
+                self.log('Setting pool %s (%d) pg_num %d -> %d' %
+                         (pool['pool_name'], pool['pool'],
+                          pool['pg_num_target'],
+                          pool['pg_num']))
+                self.raw_cluster_cmd('osd', 'pool', 'set', pool['pool_name'],
+                                     'pg_num', str(pool['pg_num']))
+
     def set_pool_pgpnum(self, pool_name, force):
         """
         Set pgpnum property of pool_name pool.