]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_manager: provide unique pool names to avoid collision
authorSamuel Just <sam.just@inktank.com>
Thu, 14 Nov 2013 22:01:51 +0000 (14:01 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 14 Nov 2013 23:13:37 +0000 (15:13 -0800)
Fixes: #6769
Signed-off-by: Samuel Just <sam.just@inktank.com>
teuthology/task/ceph_manager.py
teuthology/task/rados.py

index 804c8427daee0aa9f57b8ae57fc74e560336f9a3..51a6d4eda405bfb40cd09b1168a5029786b8554c 100644 (file)
@@ -308,6 +308,7 @@ class CephManager:
         self.ctx = ctx
         self.config = config
         self.controller = controller
+        self.next_pool_id = 0
         if (logger):
             self.log = lambda x: logger.info(x)
         else:
@@ -551,6 +552,14 @@ class CephManager:
         self.log(status)
         return status['pgmap']['num_pgs']
 
+    def create_pool_with_unique_name(self, pg_num=1):
+        name = ""
+        with self.lock:
+            name = "unique_pool_%s"%(str(self.next_pool_id),)
+            self.next_pool_id += 1
+            self.create_pool(name, pg_num)
+        return name
+
     def create_pool(self, pool_name, pg_num=1):
         with self.lock:
             assert isinstance(pool_name, str)
index 8e4f019a52e830365718ddafb06a6f4e8a6d9da0..e6bca6ef8fb8148e731fcc05cbc85d8b501f4902 100644 (file)
@@ -108,9 +108,8 @@ def task(ctx, config):
                 PREFIX = 'client.'
                 assert role.startswith(PREFIX)
                 id_ = role[len(PREFIX):]
-                pool = 'radosmodel-%s' % id_
+                pool = ctx.manager.create_pool_with_unique_name()
                 pools.append(pool)
-                ctx.manager.create_pool(pool)
                 (remote,) = ctx.cluster.only(role).remotes.iterkeys()
                 proc = remote.run(
                     args=["CEPH_CLIENT_ID={id_}".format(id_=id_)] + args +