]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: fix up for parallel work
authorSage Weil <sage@inktank.com>
Fri, 14 Jun 2013 05:27:50 +0000 (22:27 -0700)
committerSage Weil <sage@inktank.com>
Fri, 14 Jun 2013 05:48:16 +0000 (22:48 -0700)
- use a separate pool for each client
- create pool at start, destroy pool at end
- use all clients, if not explicitly specified

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/rados.py

index e316c11831ae124822aa7adfde53dc48f4e20d33..a6f96595737b09f002d4b4ccbd7ae05dd72acd1a 100644 (file)
@@ -89,25 +89,29 @@ def task(ctx, config):
                 logger=log.getChild('ceph_manager'),
                 )
 
+        clients = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
+        log.info('clients are %s' % clients)
         for i in range(int(config.get('runs', '1'))):
             log.info("starting run %s out of %s", str(i), config.get('runs', '1'))
-            ctx.manager.remove_pool('data')
-            ctx.manager.create_pool('data')
+            pool = 'radosmodel-%d' % i
+            ctx.manager.create_pool(pool)
             tests = {}
-            for role in config.get('clients', ['client.0']):
+            for role in config.get('clients', clients):
                 assert isinstance(role, basestring)
                 PREFIX = 'client.'
                 assert role.startswith(PREFIX)
                 id_ = role[len(PREFIX):]
                 (remote,) = ctx.cluster.only(role).remotes.iterkeys()
                 proc = remote.run(
-                    args=["CEPH_CLIENT_ID={id_}".format(id_=id_)] + args,
+                    args=["CEPH_CLIENT_ID={id_}".format(id_=id_)] + args +
+                    ["--pool", pool],
                     logger=log.getChild("rados.{id}".format(id=id_)),
                     stdin=run.PIPE,
                     wait=False
                     )
                 tests[id_] = proc
             run.wait(tests.itervalues())
+            ctx.manager.remove_pool(pool)
 
     running = gevent.spawn(thread)