MCPcopy Create free account
hub / github.com/ceph/ceph / expand_pool

Method expand_pool

qa/tasks/ceph_manager.py:2382–2398  ·  view source on GitHub ↗

Increase the number of pgs in a pool

(self, pool_name, by, max_pgs)

Source from the content-addressed store, hash-verified

2380 time.sleep(2)
2381
2382 def expand_pool(self, pool_name, by, max_pgs):
2383 """
2384 Increase the number of pgs in a pool
2385 """
2386 with self.lock:
2387 assert isinstance(pool_name, str)
2388 assert isinstance(by, int)
2389 assert pool_name in self.pools
2390 if self.get_num_creating() > 0:
2391 return False
2392 if (self.pools[pool_name] + by) > max_pgs:
2393 return False
2394 self.log("increase pool size by %d" % (by,))
2395 new_pg_num = self.pools[pool_name] + by
2396 self.set_pool_property(pool_name, "pg_num", new_pg_num)
2397 self.pools[pool_name] = new_pg_num
2398 return True
2399
2400 def contract_pool(self, pool_name, by, min_pgs):
2401 """

Callers 1

grow_poolMethod · 0.80

Calls 3

get_num_creatingMethod · 0.95
set_pool_propertyMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected