]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: allow pgp_num increases to be fast if pool is empty(ish)
authorSage Weil <sage@redhat.com>
Mon, 29 Apr 2019 21:17:40 +0000 (16:17 -0500)
committerSage Weil <sage@redhat.com>
Mon, 29 Apr 2019 21:17:40 +0000 (16:17 -0500)
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 <sage@redhat.com>
src/mgr/DaemonServer.cc

index bd3e1c624fe75b88f210a8494ec4515889c2bbc3..a12c093fcb904a40ad805284553984276b398397 100644 (file)
@@ -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 =