From c7c2d18da5058ffbe1f71e66a8d4c1dcfd8eacdb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 29 Apr 2019 16:17:40 -0500 Subject: [PATCH] mgr/DaemonServer: allow pgp_num increases to be fast if pool is empty(ish) If we just created a new pool and it's basically empty, there is no reason to throttle the pgp_num changes. Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index bd3e1c624fe75..a12c093fcb904 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -2558,7 +2558,12 @@ void DaemonServer::adjust_pgs() // max_misplaced, to somewhat limit the magnitude of // our potential error here. int next; - if (aggro) { + + pool_stat_t s = pg_map.get_pg_pool_sum_stat(i.first); + if (aggro || + // pool is (virtually) empty; just jump to final pgp_num? + (p.get_pgp_num_target() > p.get_pgp_num() && + s.stats.sum.num_objects <= p.get_pgp_num_target())) { next = target; } else { double room = -- 2.39.5