From 94a62a3dff847e515510550f5e8af4a61671d667 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 22 Aug 2017 12:11:25 -0700 Subject: [PATCH] mon: get writeable osdmap for added data pool Continuation of: 435717791ec499f71c9d1485b1e4e63239a343e2 Fixes: http://tracker.ceph.com/issues/21064 Signed-off-by: Patrick Donnelly --- src/mon/FSCommands.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index a8334d1164c..98f272d4b0f 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -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, -- 2.39.5