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

Method handle_osd_map

src/client/Client.cc:3123–3188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3121}
3122
3123void Client::handle_osd_map(const MConstRef<MOSDMap>& m)
3124{
3125 std::scoped_lock cl(client_lock);
3126
3127 const auto myaddrs = messenger->get_myaddrs();
3128 bool new_blocklist = objecter->with_osdmap(
3129 [&](const OSDMap& o) {
3130 return o.is_blocklisted(myaddrs);
3131 });
3132
3133 if (new_blocklist && !blocklisted) {
3134 auto epoch = objecter->with_osdmap([](const OSDMap &o){
3135 return o.get_epoch();
3136 });
3137 lderr(cct) << "I was blocklisted at osd epoch " << epoch << dendl;
3138 blocklisted = true;
3139
3140 _abort_mds_sessions(-EBLOCKLISTED);
3141
3142 // Since we know all our OSD ops will fail, cancel them all preemtively,
3143 // so that on an unhealthy cluster we can umount promptly even if e.g.
3144 // some PGs were inaccessible.
3145 objecter->op_cancel_writes(-EBLOCKLISTED);
3146
3147 }
3148
3149 if (blocklisted) {
3150 // Handle case where we were blocklisted but no longer are
3151 blocklisted = objecter->with_osdmap([myaddrs](const OSDMap &o){
3152 return o.is_blocklisted(myaddrs);});
3153 }
3154
3155 // Always subscribe to next osdmap for blocklisted client
3156 // until this client is not blocklisted.
3157 if (blocklisted) {
3158 objecter->maybe_request_map();
3159 }
3160
3161 if (objecter->osdmap_full_flag()) {
3162 _handle_full_flag(-1);
3163 } else {
3164 // Accumulate local list of full pools so that I can drop
3165 // the objecter lock before re-entering objecter in
3166 // cancel_writes
3167 std::vector<int64_t> full_pools;
3168
3169 objecter->with_osdmap([&full_pools](const OSDMap &o) {
3170 for (const auto& kv : o.get_pools()) {
3171 if (kv.second.has_flag(pg_pool_t::FLAG_FULL)) {
3172 full_pools.push_back(kv.first);
3173 }
3174 }
3175 });
3176
3177 for (auto p : full_pools)
3178 _handle_full_flag(p);
3179
3180 // Subscribe to subsequent maps to watch for the full flag going

Callers

nothing calls this directly

Calls 11

op_cancel_writesMethod · 0.80
maybe_request_mapMethod · 0.80
osdmap_full_flagMethod · 0.80
get_myaddrsMethod · 0.45
with_osdmapMethod · 0.45
is_blocklistedMethod · 0.45
get_epochMethod · 0.45
get_poolsMethod · 0.45
has_flagMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected