Skip to content

Commit

Permalink
qa/tasks/ceph_manager: always fix pgp_num when done with thrashosd task
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/19771
Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed May 3, 2017
1 parent b465540 commit da1161c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions qa/tasks/ceph_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,11 @@ def fix_pgp_num(self, pool=None):
"""
if pool is None:
pool = self.ceph_manager.get_pool()
force = False
else:
force = True
self.log("fixing pg num pool %s" % (pool,))
if self.ceph_manager.set_pool_pgpnum(pool):
if self.ceph_manager.set_pool_pgpnum(pool, force):
self.pools_to_fix_pgp_num.discard(pool)

def test_pool_min_size(self):
Expand Down Expand Up @@ -1671,14 +1674,14 @@ def expand_pool(self, pool_name, by, max_pgs):
self.pools[pool_name] = new_pg_num
return True

def set_pool_pgpnum(self, pool_name):
def set_pool_pgpnum(self, pool_name, force):
"""
Set pgpnum property of pool_name pool.
"""
with self.lock:
assert isinstance(pool_name, basestring)
assert pool_name in self.pools
if self.get_num_creating() > 0:
if not force and self.get_num_creating() > 0:
return False
self.set_pool_property(pool_name, 'pgp_num', self.pools[pool_name])
return True
Expand Down

0 comments on commit da1161c

Please sign in to comment.