Skip to content

Commit

Permalink
mon/PGMonitor: fix force_create_pg
Browse files Browse the repository at this point in the history
We weren't carefully registering the creating PG.  In
particular, the current osd mappings (acting, up, etc.)
weren't getting filled in, which meant the PG wasn't
(necessarily) mapped to an OSD until the OSDMap updated
and we recalculated mappings.

Fix by sending us through the common code path so that
all fields get updated properly.

Fixes: http://tracker.ceph.com/issues/18298
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Jan 11, 2017
1 parent 5b79424 commit c7f93e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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
13 changes: 7 additions & 6 deletions src/mon/PGMonitor.cc
Expand Up @@ -1371,12 +1371,13 @@ bool PGMonitor::prepare_command(MonOpRequestRef op)
r = 0;
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;
} else if (prefix == "pg set_full_ratio" ||
Expand Down

0 comments on commit c7f93e3

Please sign in to comment.