From 5bb9820b2d2b054dcd2309b63296d33c2538b54f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 20 Sep 2018 08:43:37 -0500 Subject: [PATCH] mgr/DaemonServer: move pending merge check for more consistent code No functional change, but this makes the code simpler to read. Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index b65119c56c623..c643cd8aaf291 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -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() -- 2.39.5