]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: move pending merge check for more consistent code
authorSage Weil <sage@redhat.com>
Thu, 20 Sep 2018 13:43:37 +0000 (08:43 -0500)
committerSage Weil <sage@redhat.com>
Sat, 20 Oct 2018 20:21:58 +0000 (15:21 -0500)
No functional change, but this makes the code simpler to read.

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

index b65119c56c62398ffcd3306fc53fa5d6aacbd551..c643cd8aaf291774e93adfc01ba451ca12c50969 100644 (file)
@@ -2277,20 +2277,20 @@ void DaemonServer::adjust_pgs()
                         << " pg_num " << p.get_pg_num()
                         << " - still creating initial pgs"
                         << dendl;
-             } else if (p.get_pg_num() != p.get_pg_num_pending() &&
-                        p.get_pg_num_target() < p.get_pg_num()) {
-               dout(10) << "pool " << i.first
-                        << " pg_num_target " << p.get_pg_num_target()
-                        << " pg_num " << p.get_pg_num()
-                        << " - decrease and pg_num_pending != pg_num, waiting"
-                        << dendl;
              } else if (p.get_pg_num_target() < p.get_pg_num()) {
                // pg_num decrease (merge)
                pg_t merge_source(p.get_pg_num() - 1, i.first);
                pg_t merge_target = merge_source.get_parent();
                bool ok = true;
                auto q = pg_map.pg_stat.find(merge_source);
-               if (p.get_pg_num() == p.get_pgp_num()) {
+               if (p.get_pg_num() != p.get_pg_num_pending()) {
+                 dout(10) << "pool " << i.first
+                          << " pg_num_target " << p.get_pg_num_target()
+                          << " pg_num " << p.get_pg_num()
+                          << " - decrease and pg_num_pending != pg_num, waiting"
+                          << dendl;
+                 ok = false;
+               } else 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()