diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index b128b5f9b8a14..fb0276c96da78 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -123,8 +123,6 @@ COMMAND("pg stat", "show placement group status.", "pg", "r", "cli,rest") COMMAND("pg getmap", "get binary pg map to -o/stdout", "pg", "r", "cli,rest") -COMMAND("pg send_pg_creates", "trigger pg creates to be issued",\ - "pg", "rw", "cli,rest") COMMAND("pg dump " \ "name=dumpcontents,type=CephChoices,strings=all|summary|sum|delta|pools|osds|pgs|pgs_brief,n=N,req=false", \ "show human-readable versions of pg map (only 'all' valid with plain)", "pg", "r", "cli,rest") diff --git a/src/mon/PGMap.h b/src/mon/PGMap.h index 7787d6cbb02e3..1c86ab3afffdb 100644 --- a/src/mon/PGMap.h +++ b/src/mon/PGMap.h @@ -412,7 +412,6 @@ class PGMapUpdater PGMap *pg_map, PGMap::Incremental *pending_inc); -protected: static void register_pg( const OSDMap &osd_map, pg_t pgid, epoch_t epoch, diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index fe7f528a855c1..b7c9870058c1a 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -236,8 +236,12 @@ void PGMonitor::upgrade_format() void PGMonitor::post_paxos_update() { dout(10) << __func__ << dendl; - if (mon->osdmon()->osdmap.get_epoch()) { - send_pg_creates(); + OSDMap& osdmap = mon->osdmon()->osdmap; + if (osdmap.get_epoch()) { + if (osdmap.get_num_up_osds() > 0) { + assert(osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB); + check_subs(); + } } } @@ -885,17 +889,6 @@ void PGMonitor::check_osd_map(epoch_t epoch) propose_pending(); } -void PGMonitor::send_pg_creates() -{ - OSDMap& osdmap = mon->osdmon()->osdmap; - if (osdmap.get_num_up_osds() == 0) - return; - - assert(osdmap.get_up_osd_features() & CEPH_FEATURE_MON_STATEFUL_SUB); - check_subs(); - return; -} - epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next) { dout(30) << __func__ << " " << pg_map.creating_pgs_by_osd_epoch << dendl; @@ -933,12 +926,7 @@ epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next) return next; } - if (con) { - con->send_message(m); - } else { - assert(mon->osdmon()->osdmap.is_up(osd)); - mon->messenger->send_message(m, mon->osdmon()->osdmap.get_inst(osd)); - } + con->send_message(m); last_sent_pg_create[osd] = ceph_clock_now(); // sub is current through last + 1 @@ -1410,10 +1398,13 @@ bool PGMonitor::prepare_command(MonOpRequestRef op) goto reply; } { - pg_stat_t& s = pending_inc.pg_stat_updates[pgid]; - s.state = PG_STATE_CREATING; - s.created = epoch; - s.last_change = ceph_clock_now(); + PGMapUpdater::register_pg( + mon->osdmon()->osdmap, + pgid, + epoch, + true, + &pg_map, + &pending_inc); } ss << "pg " << pgidstr << " now creating, ok"; goto update; diff --git a/src/mon/PGMonitor.h b/src/mon/PGMonitor.h index 2fce01200b062..e1c9c822f98f4 100644 --- a/src/mon/PGMonitor.h +++ b/src/mon/PGMonitor.h @@ -92,7 +92,6 @@ class PGMonitor : public PaxosService { void register_new_pgs(); - void send_pg_creates(); epoch_t send_pg_creates(int osd, Connection *con, epoch_t next); /**