From: Greg Farnum Date: Fri, 1 Nov 2013 22:45:02 +0000 (-0700) Subject: OSDMonitor: be a little nicer about letting users do pg splitting X-Git-Tag: v0.72~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9834ab9ab838d5164d518a96dbf4638950efe68f;p=ceph.git OSDMonitor: be a little nicer about letting users do pg splitting We were previously blocking pg splits whenever pg creations were in- progress, but we only really need to avoid splitting any pgs which are currently being created. Let the user set a different pg_num if there are no creating PGs on the pool in question. Fixes: #6673, take two Signed-off-by: Greg Farnum --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index d56953ba0699..07775fce2bf9 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2781,10 +2781,15 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, } if (n <= (int)p.get_pg_num()) { ss << "specified pg_num " << n << " <= current " << p.get_pg_num(); - } else if (!mon->pgmon()->pg_map.creating_pgs.empty()) { - ss << "currently creating pgs, wait"; - return -EAGAIN; } else { + for(set::iterator i = mon->pgmon()->pg_map.creating_pgs.begin(); + i != mon->pgmon()->pg_map.creating_pgs.end(); + ++i) { + if (i->m_pool == static_cast(pool)) { + ss << "currently creating pgs, wait"; + return -EAGAIN; + } + } p.set_pg_num(n); ss << "set pool " << pool << " pg_num to " << n; } @@ -2797,10 +2802,15 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, ss << "specified pgp_num must > 0, but you set to " << n; } else if (n > (int)p.get_pg_num()) { ss << "specified pgp_num " << n << " > pg_num " << p.get_pg_num(); - } else if (!mon->pgmon()->pg_map.creating_pgs.empty()) { - ss << "still creating pgs, wait"; - return -EAGAIN; } else { + for(set::iterator i = mon->pgmon()->pg_map.creating_pgs.begin(); + i != mon->pgmon()->pg_map.creating_pgs.end(); + ++i) { + if (i->m_pool == static_cast(pool)) { + ss << "currently creating pgs, wait"; + return -EAGAIN; + } + } p.set_pgp_num(n); ss << "set pool " << pool << " pgp_num to " << n; }