MCPcopy Create free account
hub / github.com/ceph/ceph / preprocess_boot

Method preprocess_boot

src/mon/OSDMonitor.cc:3519–3648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3517// boot --
3518
3519bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
3520{
3521 op->mark_osdmon_event(__func__);
3522 auto m = op->get_req<MOSDBoot>();
3523 int from = m->get_orig_source_inst().name.num();
3524
3525 // check permissions, ignore if failed (no response expected)
3526 MonSession *session = op->get_session();
3527 if (!session)
3528 goto ignore;
3529 if (!session->is_capable("osd", MON_CAP_X)) {
3530 dout(0) << "got preprocess_boot message from entity with insufficient caps"
3531 << session->caps << dendl;
3532 goto ignore;
3533 }
3534
3535 if (m->sb.cluster_fsid != mon.monmap->fsid) {
3536 dout(0) << "preprocess_boot on fsid " << m->sb.cluster_fsid
3537 << " != " << mon.monmap->fsid << dendl;
3538 goto ignore;
3539 }
3540
3541 if (m->get_orig_source_inst().addr.is_blank_ip()) {
3542 dout(0) << "preprocess_boot got blank addr for " << m->get_orig_source_inst() << dendl;
3543 goto ignore;
3544 }
3545
3546 ceph_assert(m->get_orig_source_inst().name.is_osd());
3547
3548 // lower bound of N-2
3549 if (!HAVE_FEATURE(m->osd_features, SERVER_SQUID)) {
3550 mon.clog->info() << "disallowing boot of OSD "
3551 << m->get_orig_source_inst()
3552 << " because the osd lacks CEPH_FEATURE_SERVER_SQUID";
3553 goto ignore;
3554 }
3555
3556 // make sure osd versions do not span more than 3 releases
3557 if (HAVE_FEATURE(m->osd_features, SERVER_TENTACLE) &&
3558 osdmap.require_osd_release < ceph_release_t::reef) {
3559 mon.clog->info() << "disallowing boot of tentacle+ OSD "
3560 << m->get_orig_source_inst()
3561 << " because require_osd_release < reef";
3562 goto ignore;
3563 }
3564 if (HAVE_FEATURE(m->osd_features, SERVER_UMBRELLA) &&
3565 osdmap.require_osd_release < ceph_release_t::squid) {
3566 mon.clog->info() << "disallowing boot of umbrella+ OSD "
3567 << m->get_orig_source_inst()
3568 << " because require_osd_release < squid";
3569 goto ignore;
3570 }
3571
3572 // See crimson/osd/osd.cc: OSD::_send_boot
3573 if (auto type_iter = m->metadata.find("osd_type");
3574 type_iter != m->metadata.end()) {
3575 const auto &otype = type_iter->second;
3576 // m->metadata["osd_type"] must be "crimson", classic doesn't send osd_type

Callers

nothing calls this directly

Calls 15

mark_osdmon_eventMethod · 0.80
is_blank_ipMethod · 0.80
get_allow_crimsonMethod · 0.80
legacy_equalsMethod · 0.80
get_orig_source_addrsMethod · 0.80
get_orig_sourceMethod · 0.80
get_uuidMethod · 0.80
numMethod · 0.45
get_orig_source_instMethod · 0.45
get_sessionMethod · 0.45
is_capableMethod · 0.45
is_osdMethod · 0.45

Tested by

no test coverage detected