[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ceph-commit
Subject:    [ceph-commit] branch master updated. 5cb2631e7cf97c12e91de83fcaa37c645647bce0
From:       ceph-commit () ceph ! com (ceph-qa-suite ! git)
Date:       2015-05-29 22:18:57
Message-ID: 20150529221857.D6F463F765 () ds3426 ! dreamservers ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, master has been updated
       via  5cb2631e7cf97c12e91de83fcaa37c645647bce0 (commit)
       via  3127cda33a99943b6ae3600db358a7d7bc54fd9e (commit)
       via  91b300d12caefa4c8e7881abea9e5145fbbd3b12 (commit)
      from  3f154583913fe3be7b07cbfa7d28d9cb6880f160 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5cb2631e7cf97c12e91de83fcaa37c645647bce0
Merge: 3f15458 3127cda
Author: Samuel Just <sam.just at inktank.com>
Date:   Fri May 29 15:17:22 2015 -0700

    Merge pull request #451 from athanatos/wip-11677
    
    Wip 11677
    
    Reviewed-by: Sage Weil <sage at redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 suites/rados/thrash/workloads/rgw_snaps.yaml |   25 +++++++++++
 tasks/ceph_manager.py                        |   18 ++++++++
 tasks/rados.py                               |   29 ++++++++++---
 tasks/thrash_pool_snaps.py                   |   60 ++++++++++++++++++++++++++
 4 files changed, 126 insertions(+), 6 deletions(-)
 create mode 100644 suites/rados/thrash/workloads/rgw_snaps.yaml
 create mode 100644 tasks/thrash_pool_snaps.py

diff --git a/suites/rados/thrash/workloads/rgw_snaps.yaml b/suites/rados/thrash/workloads/rgw_snaps.yaml
new file mode 100644
index 0000000..8200cc3
--- /dev/null
+++ b/suites/rados/thrash/workloads/rgw_snaps.yaml
@@ -0,0 +1,25 @@
+tasks:
+- rgw:
+    default_idle_timeout: 3600
+    client.0: null
+- thrash_pool_snaps:
+    pools:
+    - .rgw.buckets
+    - .rgw.root
+    - .rgw.control
+    - .rgw
+    - .users.uid
+    - .users.email
+    - .users
+- s3readwrite:
+    client.0:
+      rgw_server: client.0
+      readwrite:
+        bucket: rwtest
+        readers: 10
+        writers: 3
+        duration: 300
+        files:
+          num: 10
+          size: 2000
+          stddev: 500
diff --git a/tasks/ceph_manager.py b/tasks/ceph_manager.py
index 5b62d10..dbaac40 100644
--- a/tasks/ceph_manager.py
+++ b/tasks/ceph_manager.py
@@ -1137,6 +1137,24 @@ class CephManager:
                                      pool_name, str(pg_num))
             self.pools[pool_name] = pg_num
 
+    def add_pool_snap(self, pool_name, snap_name):
+        """
+        Add pool snapshot
+        :param pool_name: name of pool to snapshot
+        :param snap_name: name of snapshot to take
+        """
+        self.raw_cluster_cmd('osd', 'pool', 'mksnap',
+                             str(pool_name), str(snap_name))
+
+    def remove_pool_snap(self, pool_name, snap_name):
+        """
+        Remove pool snapshot
+        :param pool_name: name of pool to snapshot
+        :param snap_name: name of snapshot to remove
+        """
+        self.raw_cluster_cmd('osd', 'pool', 'rmsnap',
+                             str(pool_name), str(snap_name))
+
     def remove_pool(self, pool_name):
         """
         Remove the indicated pool
diff --git a/tasks/rados.py b/tasks/rados.py
index e5f83cb..044770e 100644
--- a/tasks/rados.py
+++ b/tasks/rados.py
@@ -141,9 +141,6 @@ def task(ctx, config):
     if config.get('pool_snaps', False):
         args.extend(['--pool-snaps'])
     args.extend([
-        '--op', 'read', str(op_weights.get('read', 100)),
-        '--op', 'write', str(op_weights.get('write', 100)),
-        '--op', 'delete', str(op_weights.get('delete', 10)),
         '--max-ops', str(config.get('ops', 10000)),
         '--objects', str(config.get('objects', 500)),
         '--max-in-flight', str(config.get('max_in_flight', 16)),
@@ -152,6 +149,11 @@ def task(ctx, config):
         '--max-stride-size', str(config.get('max_stride_size', object_size / 5)),
         '--max-seconds', str(config.get('max_seconds', 0))
         ])
+
+    weights = {}
+    weights['read'] = 100
+    weights['write'] = 100
+    weights['delete'] = 10
     # Parallel of the op_types in test/osd/TestRados.cc
     for field in [
         # read handled above
@@ -171,11 +173,26 @@ def task(ctx, config):
         "cache_try_flush",
         "cache_evict",
         "append",
+        "write",
+        "read",
+        "delete"
         ]:
         if field in op_weights:
-            args.extend([
-                    '--op', field, str(op_weights[field]),
-                    ])
+            weights[field] = op_weights[field]
+
+    if 'write' in weights:
+        weights['write'] = weights['write'] / 2
+        weights['write_excl'] = weights['write']
+
+    if 'append' in weights:
+        weights['append'] = weights['append'] / 2
+        weights['append_excl'] = weights['append']
+
+    for op, weight in weights.iteritems():
+        args.extend([
+            '--op', op, str(weight)
+        ])
+                
 
     def thread():
         """Thread spawned by gevent"""
diff --git a/tasks/thrash_pool_snaps.py b/tasks/thrash_pool_snaps.py
new file mode 100644
index 0000000..1c3f8f4
--- /dev/null
+++ b/tasks/thrash_pool_snaps.py
@@ -0,0 +1,60 @@
+"""
+Thrash -- Simulate random osd failures.
+"""
+import contextlib
+import logging
+import gevent
+import time
+import random
+
+
+log = logging.getLogger(__name__)
+
+ at contextlib.contextmanager
+def task(ctx, config):
+    """
+    "Thrash" snap creation and removal on the listed pools
+
+    Example:
+
+    thrash_pool_snaps:
+      pools: [.rgw.buckets, .rgw.buckets.index]
+      max_snaps: 10
+      min_snaps: 5
+      period: 10
+    """
+    stopping = False
+    def do_thrash():
+        pools = config.get('pools', [])
+        max_snaps = config.get('max_snaps', 10)
+        min_snaps = config.get('min_snaps', 5)
+        period = config.get('period', 30)
+        snaps = []
+        def remove_snap():
+            assert len(snaps) > 0
+            snap = random.choice(snaps)
+            log.info("Removing snap %s" % (snap,))
+            for pool in pools:
+                ctx.manager.remove_pool_snap(pool, str(snap))
+            snaps.remove(snap)
+        def add_snap(snap):
+            log.info("Adding snap %s" % (snap,))
+            for pool in pools:
+                ctx.manager.add_pool_snap(pool, str(snap))
+            snaps.append(snap)
+        index = 0
+        while not stopping:
+            index += 1
+            time.sleep(period)
+            if len(snaps) <= min_snaps:
+                add_snap(index)
+            elif len(snaps) >= max_snaps:
+                remove_snap()
+            else:
+                random.choice([lambda: add_snap(index), remove_snap])()
+        log.info("Stopping")
+    thread = gevent.spawn(do_thrash)
+    yield
+    stopping = True
+    thread.join()
+


hooks/post-receive
-- 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic