This dependency also pops up in PeeringState::check_past_interval_bounds().
PeeringState::get_required_past_interval_bounds takes as a parameter
-oldest_epoch, which comes from OSDSuperblock::max_oldest_map. We use
-max_oldest_map rather than a specific osd's oldest_map because we don't
-necessarily trim all MOSDMap::oldest_map. In order to avoid doing too much
-work at once we limit the amount of osdmaps trimmed using
+oldest_epoch, which comes from OSDSuperblock::cluster_osdmap_trim_lower_bound.
+We use cluster_osdmap_trim_lower_bound rather than a specific osd's oldest_map
+because we don't necessarily trim all MOSDMap::oldest_map. In order to avoid
+doing too much work at once we limit the amount of osdmaps trimmed using
``osd_target_transaction_size`` in OSD::trim_maps().
-For this reason, a specific OSD's oldest_map can lag OSDSuperblock::max_oldest_map
+For this reason, a specific OSD's oldest_map can lag behind
+OSDSuperblock::cluster_osdmap_trim_lower_bound
for a while.
See https://tracker.ceph.com/issues/49689 for an example.
// Not needed yet
}
- epoch_t max_oldest_stored_osdmap() final {
+ epoch_t cluster_osdmap_trim_lower_bound() final {
// TODO
return 0;
}
{
MOSDMap *m = new MOSDMap(monc->get_fsid(),
osdmap->get_encoding_features());
- m->oldest_map = sblock.max_oldest_map;
+ m->oldest_map = sblock.cluster_osdmap_trim_lower_bound;
m->newest_map = sblock.newest_map;
int max = cct->_conf->osd_map_message_max;
// we don't have the next map the target wants, so start with a
// full map.
bufferlist bl;
- dout(10) << __func__ << " oldest map " << sblock.max_oldest_map
+ dout(10) << __func__ << " cluster osdmap lower bound "
+ << sblock.cluster_osdmap_trim_lower_bound
<< " > since " << since << ", starting with full map"
<< dendl;
since = m->oldest_map;
// just send latest full map
MOSDMap *m = new MOSDMap(monc->get_fsid(),
osdmap->get_encoding_features());
- m->oldest_map = sblock.max_oldest_map;
+ m->oldest_map = sblock.cluster_osdmap_trim_lower_bound;
m->newest_map = sblock.newest_map;
get_map_bl(to, m->maps[to]);
send_map(m, con);
// do anything else
dout(5) << "Upgrading superblock adding: " << diff << dendl;
- if (!superblock.max_oldest_map) {
- superblock.max_oldest_map = superblock.oldest_map;
+ if (!superblock.cluster_osdmap_trim_lower_bound) {
+ superblock.cluster_osdmap_trim_lower_bound = superblock.oldest_map;
}
ObjectStore::Transaction t;
if (first <= superblock.newest_map)
logger->inc(l_osd_mape_dup, superblock.newest_map - first + 1);
- if (superblock.max_oldest_map < m->oldest_map) {
- superblock.max_oldest_map = m->oldest_map;
- dout(10) << " superblock max_oldest_map new epoch is: "
- << superblock.max_oldest_map << dendl;
- ceph_assert(superblock.max_oldest_map >= superblock.oldest_map);
+ if (superblock.cluster_osdmap_trim_lower_bound < m->oldest_map) {
+ superblock.cluster_osdmap_trim_lower_bound = m->oldest_map;
+ dout(10) << " superblock cluster_osdmap_trim_lower_bound new epoch is: "
+ << superblock.cluster_osdmap_trim_lower_bound << dendl;
+ ceph_assert(
+ superblock.cluster_osdmap_trim_lower_bound >= superblock.oldest_map);
}
// make sure there is something new, here, before we bother flushing
cancel_recovery();
}
-epoch_t PG::max_oldest_stored_osdmap() {
- return osd->get_superblock().max_oldest_map;
+epoch_t PG::cluster_osdmap_trim_lower_bound() {
+ return osd->get_superblock().cluster_osdmap_trim_lower_bound;
}
OstreamTemp PG::get_clog_info() {
void clear_publish_stats() override;
void clear_primary_state() override;
- epoch_t max_oldest_stored_osdmap() override;
+ epoch_t cluster_osdmap_trim_lower_bound() override;
OstreamTemp get_clog_error() override;
OstreamTemp get_clog_info() override;
OstreamTemp get_clog_debug() override;
psdout(10) << __func__ << ": check_new_interval output: "
<< debug.str() << dendl;
if (new_interval) {
- if (osdmap->get_epoch() == pl->max_oldest_stored_osdmap() &&
+ if (osdmap->get_epoch() == pl->cluster_osdmap_trim_lower_bound() &&
info.history.last_epoch_clean < osdmap->get_epoch()) {
psdout(10) << " map gap, clearing past_intervals and faking" << dendl;
// our information is incomplete and useless; someone else was clean
void PeeringState::check_past_interval_bounds() const
{
- // a specific OSD's oldest_map can lag for a while, therfore
- // use the maximum MOSDMap.oldest_map received with peers.
- auto oldest_epoch = pl->max_oldest_stored_osdmap();
+ // cluster_osdmap_trim_lower_bound gives us a bound on needed
+ // intervals, see doc/dev/osd_internals/past_intervals.rst
+ auto oldest_epoch = pl->cluster_osdmap_trim_lower_bound();
auto rpib = get_required_past_interval_bounds(
info,
oldest_epoch);
// ==================== Std::map notifications ===================
virtual void on_active_actmap() = 0;
virtual void on_active_advmap(const OSDMapRef &osdmap) = 0;
- virtual epoch_t max_oldest_stored_osdmap() = 0;
+ virtual epoch_t cluster_osdmap_trim_lower_bound() = 0;
// ============ recovery reservation notifications ==========
virtual void on_backfill_reserved() = 0;
encode((uint32_t)0, bl); // map<int64_t,epoch_t> pool_last_epoch_marked_full
encode(purged_snaps_last, bl);
encode(last_purged_snaps_scrub, bl);
- encode(max_oldest_map, bl);
+ encode(cluster_osdmap_trim_lower_bound, bl);
ENCODE_FINISH(bl);
}
purged_snaps_last = 0;
}
if (struct_v >= 10) {
- decode(max_oldest_map, bl);
+ decode(cluster_osdmap_trim_lower_bound, bl);
} else {
- max_oldest_map = 0;
+ cluster_osdmap_trim_lower_bound = 0;
}
DECODE_FINISH(bl);
}
f->dump_int("last_epoch_mounted", mounted);
f->dump_unsigned("purged_snaps_last", purged_snaps_last);
f->dump_stream("last_purged_snaps_scrub") << last_purged_snaps_scrub;
- f->dump_int("max_oldest_map", max_oldest_map);
+ f->dump_int("cluster_osdmap_trim_lower_bound",
+ cluster_osdmap_trim_lower_bound);
}
void OSDSuperblock::generate_test_instances(list<OSDSuperblock*>& o)
epoch_t purged_snaps_last = 0;
utime_t last_purged_snaps_scrub;
- epoch_t max_oldest_map = 0; // maximum oldest map we have.
+ epoch_t cluster_osdmap_trim_lower_bound = 0;
void encode(ceph::buffer::list &bl) const;
void decode(ceph::buffer::list::const_iterator &bl);
<< " e" << sb.current_epoch
<< " [" << sb.oldest_map << "," << sb.newest_map << "]"
<< " lci=[" << sb.mounted << "," << sb.clean_thru << "]"
- << " max oldest=" << sb.max_oldest_map << ")";
+ << " tlb=" << sb.cluster_osdmap_trim_lower_bound
+ << ")";
}