logger().error("MOSDMap lied about what maps it had?");
return seastar::now();
}
+ }).then([&t, this, &added_maps] {
+ auto [e, map] = *added_maps.begin();
+ auto lastmap = osdmaps.find(e - 1).get();
+ meta_coll->store_final_pool_info(t, lastmap, added_maps);
+ return seastar::now();
});
+ });
}
+// Note: store/set_superblock is called in later OSD::handle_osd_map
+// so we use the OSD's superblock reference meanwhile.
+void OSDSingletonState::trim_maps(ceph::os::Transaction& t,
+ OSDSuperblock& superblock)
+{
+ epoch_t min =
+ std::min(superblock.cluster_osdmap_trim_lower_bound,
+ osdmaps.cached_key_lower_bound());
+
+ if (min <= superblock.get_oldest_map()) {
+ return;
+ }
+ logger().debug("{}: min={} oldest_map={}", __func__, min, superblock.get_oldest_map());
+
+ // Trim from the superblock's oldest_map up to `min`.
+ // Break if we have exceeded the txn target size.
+ while (superblock.get_oldest_map() < min &&
+ t.get_num_ops() < crimson::common::local_conf()->osd_target_transaction_size) {
+ logger().debug("{}: removing old osdmap epoch {}", __func__, superblock.get_oldest_map());
+ meta_coll->remove_map(t, superblock.get_oldest_map());
+ superblock.maps.erase(superblock.get_oldest_map());
+ }
+
+ // we should not trim past osdmaps.cached_key_lower_bound()
+ // as there may still be PGs with those map epochs recorded.
+ ceph_assert(min <= osdmaps.cached_key_lower_bound());
+}
+
seastar::future<Ref<PG>> ShardServices::make_pg(
OSDMapService::cached_map_t create_map,
spg_t pgid,