mon: get writeable osdmap for added data pool

Continuation of: 435717791e

Fixes: http://tracker.ceph.com/issues/21064

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2017-08-22 12:11:25 -07:00
parent 60eb0e58d9
commit 94a62a3dff
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View File

@ -521,8 +521,17 @@ class AddDataPoolHandler : public FileSystemCommandHandler
return 0;
}
mon->osdmon()->do_application_enable(poolid,
pg_pool_t::APPLICATION_NAME_CEPHFS);
// 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(poolid, pg_pool_t::APPLICATION_NAME_CEPHFS);
mon->osdmon()->propose_pending();
}
fsmap.modify_filesystem(
fs->fscid,