]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/thrashosds: chance_thrash_cluster_full
authorSage Weil <sage@redhat.com>
Fri, 3 Mar 2017 14:45:10 +0000 (08:45 -0600)
committerSage Weil <sage@redhat.com>
Tue, 7 Mar 2017 18:33:44 +0000 (13:33 -0500)
Induce a momentarily full cluster.

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

index e3e20c822ca02f8e51b9acad9faf1d80de0ea533..8df5920e366e1c60ab829064a1194754c8b9f6c2 100644 (file)
@@ -122,6 +122,7 @@ class Thrasher:
         self.optrack_toggle_delay = self.config.get('optrack_toggle_delay')
         self.dump_ops_enable = self.config.get('dump_ops_enable')
         self.noscrub_toggle_delay = self.config.get('noscrub_toggle_delay')
+        self.chance_thrash_cluster_full = self.config.get('chance_thrash_cluster_full', .05)
 
         num_osds = self.in_osds + self.out_osds
         self.max_pgs = self.config.get("max_pgs_per_pool_osd", 1200) * num_osds
@@ -494,6 +495,16 @@ class Thrasher:
         self.ceph_manager.raw_cluster_cmd('osd', 'primary-affinity',
                                           str(osd), str(pa))
 
+    def thrash_cluster_full(self):
+        """
+        Set and unset cluster full condition
+        """
+        self.log('Setting full ratio to .001')
+        self.ceph_manager.raw_cluster_cmd('pg', 'set_full_ratio', '.001')
+        time.sleep(1)
+        self.log('Setting full ratio back to .95')
+        self.ceph_manager.raw_cluster_cmd('pg', 'set_full_ratio', '.95')
+
     def all_up(self):
         """
         Make sure all osds are up and not out.
@@ -710,6 +721,8 @@ class Thrasher:
                         chance_test_min_size,))
         actions.append((self.test_backfill_full,
                         chance_test_backfill_full,))
+        if self.chance_thrash_cluster_full > 0:
+            actions.append((self.thrash_cluster_full, self.chance_thrash_cluster_full,))
         for key in ['heartbeat_inject_failure', 'filestore_inject_stall']:
             for scenario in [
                 (lambda:
index 9f60bceddc08aa00cf33bb9bb2c800da507cec88..876aab395ec7d91c640f67816db743614db94f58 100644 (file)
@@ -120,6 +120,8 @@ def task(ctx, config):
     disable_objectstore_tool_tests: (false) disable ceph_objectstore_tool based
                                     tests
 
+    chance_thrash_cluster_full: .05
+
     example:
 
     tasks: