]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/DaemonServer: block pg_num decrease(merge) until pgp_num is reduced
authorSage Weil <sage@redhat.com>
Wed, 19 Sep 2018 21:34:21 +0000 (16:34 -0500)
committerSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 12:22:48 +0000 (07:22 -0500)
We can't merge until the PGs are stored together.  (The mon would stop
us if we tried, but let's not waste time trying.)

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc

index 8a3be01c9980dce6ece894e305196896b4d9e51f..0d9eefd982feb581e23a84f57b66127487f338a8 100644 (file)
@@ -2279,7 +2279,14 @@ void DaemonServer::adjust_pgs()
                pg_t merge_target = merge_source.get_parent();
                bool ok = true;
                auto q = pg_map.pg_stat.find(merge_source);
-               if (q == pg_map.pg_stat.end()) {
+               if (p.get_pg_num() == p.get_pgp_num()) {
+                 dout(10) << "pool " << i.first
+                          << " pg_num_target " << p.get_pg_num_target()
+                          << " pg_num " << p.get_pg_num()
+                          << " - decrease blocked by pgp_num "
+                          << p.get_pgp_num()
+                          << dendl;
+                 ok = false;
                } else if (q == pg_map.pg_stat.end()) {
                  dout(10) << "pool " << i.first
                           << " pg_num_target " << p.get_pg_num_target()