Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: fix force_pg_create pg stuck in creating bug #12539

Merged
merged 3 commits into from Feb 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/mon/MonCommands.h
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion src/mon/PGMap.h
Expand Up @@ -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,
Expand Down
37 changes: 14 additions & 23 deletions src/mon/PGMonitor.cc
Expand Up @@ -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();
}
}
}

Expand Down Expand Up @@ -879,17 +883,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;
Expand Down Expand Up @@ -927,12 +920,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
Expand Down Expand Up @@ -1393,10 +1381,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;
Expand Down
1 change: 0 additions & 1 deletion src/mon/PGMonitor.h
Expand Up @@ -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);

/**
Expand Down