Skip to content

Commit

Permalink
Merge pull request #17607 from liewegas/wip-post-luminous-more-mon
Browse files Browse the repository at this point in the history
mon: post-luminous cleanup (part 3 of ?)

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
liewegas committed Sep 19, 2017
2 parents 1722d45 + 8ade1af commit 25e2fe3
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 450 deletions.
2 changes: 1 addition & 1 deletion src/include/ceph_features.h
Expand Up @@ -89,7 +89,7 @@ DEFINE_CEPH_FEATURE_RETIRED(14, 1, OMAP, HAMMER, JEWEL)
DEFINE_CEPH_FEATURE(14, 2, SERVER_KRAKEN)
DEFINE_CEPH_FEATURE(15, 1, MONENC)
DEFINE_CEPH_FEATURE_RETIRED(16, 1, QUERY_T, JEWEL, LUMINOUS)

DEFINE_CEPH_FEATURE(16, 3, SERVER_O)
DEFINE_CEPH_FEATURE_RETIRED(17, 1, INDEP_PG_MAP, JEWEL, LUMINOUS)

DEFINE_CEPH_FEATURE(18, 1, CRUSH_TUNABLES)
Expand Down
38 changes: 15 additions & 23 deletions src/mon/FSCommands.cc
Expand Up @@ -189,20 +189,16 @@ class FsNewHandler : public FileSystemCommandHandler
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();
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.
fsmap.create_filesystem(fs_name, metadata, data,
Expand Down Expand Up @@ -521,17 +517,13 @@ class AddDataPoolHandler : public FileSystemCommandHandler
return 0;
}

// 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();
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,
Expand Down
4 changes: 0 additions & 4 deletions src/mon/MgrStatMonitor.cc
Expand Up @@ -62,10 +62,6 @@ void MgrStatMonitor::update_from_paxos(bool *need_bootstrap)
void MgrStatMonitor::update_logger()
{
dout(20) << __func__ << dendl;
if (mon->osdmon()->osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
dout(20) << "yielding cluster perfcounter updates to pgmon" << dendl;
return;
}

mon->cluster_logger->set(l_cluster_osd_bytes, digest.osd_sum.kb * 1024ull);
mon->cluster_logger->set(l_cluster_osd_bytes_used,
Expand Down
15 changes: 3 additions & 12 deletions src/mon/Monitor.cc
Expand Up @@ -1772,7 +1772,8 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
<< " upgrading" << dendl;
exit(0);
}
if (!osdmon()->osdmap.test_flag(CEPH_OSDMAP_PURGED_SNAPDIRS)) {
if (!osdmon()->osdmap.test_flag(CEPH_OSDMAP_PURGED_SNAPDIRS) ||
!osdmon()->osdmap.test_flag(CEPH_OSDMAP_RECOVERY_DELETES)) {
derr << __func__ << " existing cluster has not completed a full luminous"
<< " scrub to purge legacy snapdir objects; please scrub before"
<< " upgrading beyond luminous." << dendl;
Expand Down Expand Up @@ -1979,15 +1980,6 @@ void Monitor::lose_election(epoch_t epoch, set<int> &q, int l,
logger->inc(l_mon_election_lose);

finish_election();

if ((quorum_con_features & CEPH_FEATURE_MON_METADATA) &&
!HAVE_FEATURE(quorum_con_features, SERVER_LUMINOUS)) {
// for pre-luminous mons only
Metadata sys_info;
collect_metadata(&sys_info);
messenger->send_message(new MMonMetadata(sys_info),
monmap->get_inst(get_leader()));
}
}

void Monitor::collect_metadata(Metadata *m)
Expand Down Expand Up @@ -3006,8 +2998,7 @@ void Monitor::handle_command(MonOpRequestRef op)
<< "entity='" << session->entity_name << "' "
<< "cmd=" << m->cmd << ": dispatch";

if (mon_cmd->is_mgr() &&
osdmon()->osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) {
if (mon_cmd->is_mgr()) {
const auto& hdr = m->get_header();
uint64_t size = hdr.front_len + hdr.middle_len + hdr.data_len;
uint64_t max =
Expand Down

0 comments on commit 25e2fe3

Please sign in to comment.