mdsmon: treat the osdmon correctly when doing plugged updates

Make sure it's writeable before invoking changes, and propose_pending()
on it when we're done.
Make the PaxosService::C_RetryMessage public so we can do this from FSCommands.

Maybe-
Fixes: http://tracker.ceph.com/issues/20959

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
Greg Farnum 2017-08-09 14:34:44 -07:00
parent bcd3554bc5
commit 435717791e
3 changed files with 14 additions and 13 deletions

View File

@ -179,11 +179,6 @@ class FsNewHandler : public FileSystemCommandHandler
pg_pool_t const *metadata_pool = mon->osdmon()->osdmap.get_pg_pool(metadata);
assert(metadata_pool != NULL); // Checked it existed above
// we must make these checks before we even allow ourselves to *think*
// about requesting a proposal to the osdmonitor and bail out now if
// we believe we must. bailing out *after* we request the proposal is
// bad business as we could have changed the osdmon's state and ending up
// returning an error to the user.
int r = _check_pool(mon->osdmon()->osdmap, data, false, force, &ss);
if (r < 0) {
return r;
@ -193,13 +188,20 @@ class FsNewHandler : public FileSystemCommandHandler
if (r < 0) {
return r;
}
// if we're running as luminous, we have to set the pool application metadata
if (mon->osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS ||
mon->osdmon()->pending_inc.new_require_osd_release >= CEPH_RELEASE_LUMINOUS) {
if (!mon->osdmon()->is_writeable()) {
// not allowed to write yet, so retry when we can
mon->osdmon()->wait_for_writeable(op, new PaxosService::C_RetryMessage(mon->mdsmon(), op));
return -EAGAIN;
}
mon->osdmon()->do_application_enable(data,
pg_pool_t::APPLICATION_NAME_CEPHFS);
mon->osdmon()->do_application_enable(metadata,
pg_pool_t::APPLICATION_NAME_CEPHFS);
mon->osdmon()->propose_pending();
}
// All checks passed, go ahead and create.

View File

@ -3156,7 +3156,7 @@ void OSDMonitor::check_pg_creates_sub(Subscription *sub)
void OSDMonitor::do_application_enable(int64_t pool_id,
const std::string &app_name)
{
assert(paxos->is_plugged());
assert(paxos->is_plugged() && is_writeable());
dout(20) << __func__ << ": pool_id=" << pool_id << ", app_name=" << app_name
<< dendl;

View File

@ -83,17 +83,17 @@ protected:
* Child must populate this during encode_pending() by calling encode_health().
*/
health_check_map_t health_checks;
public:
const health_check_map_t& get_health_checks() {
return health_checks;
}
protected:
/**
* format of our state in leveldb, 0 for default
*/
version_t format_version;
public:
const health_check_map_t& get_health_checks() {
return health_checks;
}
/**
* @defgroup PaxosService_h_callbacks Callback classes
* @{
@ -128,7 +128,6 @@ protected:
* @}
*/
public:
/**
* @param mn A Monitor instance
* @param p A Paxos instance