| 1229 | } |
| 1230 | |
| 1231 | void Objecter::handle_osd_map(MOSDMap *m) |
| 1232 | { |
| 1233 | ceph::shunique_lock sul(rwlock, acquire_unique); |
| 1234 | if (!initialized) |
| 1235 | return; |
| 1236 | |
| 1237 | ceph_assert(osdmap); |
| 1238 | |
| 1239 | if (m->fsid != monc->get_fsid()) { |
| 1240 | ldout(cct, 0) << "handle_osd_map fsid " << m->fsid |
| 1241 | << " != " << monc->get_fsid() << dendl; |
| 1242 | return; |
| 1243 | } |
| 1244 | |
| 1245 | bool was_pauserd = osdmap->test_flag(CEPH_OSDMAP_PAUSERD); |
| 1246 | bool cluster_full = _osdmap_full_flag(); |
| 1247 | bool was_pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || cluster_full || |
| 1248 | _osdmap_has_pool_full(); |
| 1249 | map<int64_t, bool> pool_full_map; |
| 1250 | for (auto it = osdmap->get_pools().begin(); |
| 1251 | it != osdmap->get_pools().end(); ++it) |
| 1252 | pool_full_map[it->first] = _osdmap_pool_full(it->second); |
| 1253 | |
| 1254 | |
| 1255 | list<LingerOp*> need_resend_linger; |
| 1256 | map<ceph_tid_t, Op*> need_resend; |
| 1257 | map<ceph_tid_t, CommandOp*> need_resend_command; |
| 1258 | |
| 1259 | if (m->get_last() <= osdmap->get_epoch()) { |
| 1260 | ldout(cct, 3) << "handle_osd_map ignoring epochs [" |
| 1261 | << m->get_first() << "," << m->get_last() |
| 1262 | << "] <= " << osdmap->get_epoch() << dendl; |
| 1263 | } else { |
| 1264 | ldout(cct, 3) << "handle_osd_map got epochs [" |
| 1265 | << m->get_first() << "," << m->get_last() |
| 1266 | << "] > " << osdmap->get_epoch() << dendl; |
| 1267 | |
| 1268 | if (osdmap->get_epoch()) { |
| 1269 | bool skipped_map = false; |
| 1270 | // we want incrementals |
| 1271 | for (epoch_t e = osdmap->get_epoch() + 1; |
| 1272 | e <= m->get_last(); |
| 1273 | e++) { |
| 1274 | |
| 1275 | if (osdmap->get_epoch() == e-1 && |
| 1276 | m->incremental_maps.count(e)) { |
| 1277 | ldout(cct, 3) << "handle_osd_map decoding incremental epoch " << e |
| 1278 | << dendl; |
| 1279 | OSDMap::Incremental inc(m->incremental_maps[e]); |
| 1280 | osdmap->apply_incremental(inc); |
| 1281 | |
| 1282 | emit_blocklist_events(inc); |
| 1283 | |
| 1284 | logger->inc(l_osdc_map_inc); |
| 1285 | } |
| 1286 | else if (m->maps.count(e)) { |
| 1287 | ldout(cct, 3) << "handle_osd_map decoding full epoch " << e << dendl; |
| 1288 | auto new_osdmap = std::make_unique<OSDMap>(); |
nothing calls this directly
no test coverage detected