]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/thrashosds: chance_thrash_cluster_full 17893/head
authorSage Weil <sage@redhat.com>
Fri, 3 Mar 2017 14:45:10 +0000 (08:45 -0600)
committerDavid Zafman <dzafman@redhat.com>
Thu, 21 Sep 2017 03:03:11 +0000 (20:03 -0700)
Induce a momentarily full cluster.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a202b68d18ccf32d9ae2580fecdbbb6ebaed5d30)

Conflicts:
qa/tasks/ceph_manager.py (trivial)
qa/tasks/thrashosds.py (trivial)

qa/tasks/ceph_manager.py
qa/tasks/thrashosds.py

index 7abcd1af55c65b6508a7e54588f1b0c9f67adf72..5f2f61885ba5ea0bdfaaa7136e2e8c2b4378e194 100644 (file)
@@ -114,6 +114,7 @@ class Thrasher:
         self.minin = self.config.get("min_in", 3)
         self.chance_move_pg = self.config.get('chance_move_pg', 1.0)
         self.sighup_delay = self.config.get('sighup_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
@@ -456,6 +457,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.
@@ -659,6 +670,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 fb1defbb7bf1b3ce66b21c36bdee0f29182f9755..0624503e34fbc3f78f16a5fc21170cbeb77eaac5 100644 (file)
@@ -102,6 +102,8 @@ def task(ctx, config):
     ceph_objectstore_tool: (true) whether to export/import a pg while an osd is down
     chance_move_pg: (1.0) chance of moving a pg if more than 1 osd is down (default 100%)
 
+    chance_thrash_cluster_full: .05
+
     example:
 
     tasks: