From: Matan Breizman Date: Thu, 6 Jul 2023 10:22:03 +0000 (+0000) Subject: osd/OSD: trim_maps - remove nrecieved X-Git-Tag: v19.0.0~639^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cfda368b49ab87f9b7c47d279ddc488acc0dabaf;p=ceph.git osd/OSD: trim_maps - remove nrecieved The intention of `nrecieved` was to guarantee that we will trim [first, last) of the current MOSDMap being handled. However, this is not true anymore since we trim based on cluster_osdmap_trim_lower_bound. For instance, we might begin trimming when we receieve a MOSDMap with first epoch of 799 and last of 800 and cluster_osdmap_trim_lower_bound of 200. If our superblock's oldest_map is 1 (no trimming occurred yet), we are allowed to trim up to 200. There is no relation between the current MOSDMap handled amount of epochs receieved (last - first + 1) to the epoch where we allowed to trim to. Signed-off-by: Matan Breizman --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index e5e68c8aa88..705ad0ca0fa 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7945,7 +7945,7 @@ void OSD::osdmap_subscribe(version_t epoch, bool force_request) } } -void OSD::trim_maps(epoch_t oldest, int nreceived, bool skip_maps) +void OSD::trim_maps(epoch_t oldest, bool skip_maps) { epoch_t min = std::min(oldest, service.map_cache.cached_key_lower_bound()); if (min <= superblock.oldest_map) @@ -7959,10 +7959,7 @@ void OSD::trim_maps(epoch_t oldest, int nreceived, bool skip_maps) t.remove(coll_t::meta(), get_inc_osdmap_pobject_name(e)); superblock.oldest_map = e + 1; num++; - // make sure we at least keep pace with incoming maps - // even if we exceed osd_target_transaction_size. - if (num >= cct->_conf->osd_target_transaction_size && - num >= nreceived) { + if (num >= cct->_conf->osd_target_transaction_size) { service.publish_superblock(superblock); write_superblock(cct, superblock, t); int tr = store->queue_transaction(service.meta_ch, std::move(t), nullptr); @@ -8227,8 +8224,7 @@ void OSD::handle_osd_map(MOSDMap *m) } if (superblock.oldest_map) { - trim_maps(m->cluster_osdmap_trim_lower_bound, - last - first + 1, skip_maps); + trim_maps(m->cluster_osdmap_trim_lower_bound, skip_maps); pg_num_history.prune(superblock.oldest_map); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 7003c1b7b86..3993e7a2fbd 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1685,7 +1685,7 @@ protected: void handle_osd_map(class MOSDMap *m); void _committed_osd_maps(epoch_t first, epoch_t last, class MOSDMap *m); - void trim_maps(epoch_t oldest, int nreceived, bool skip_maps); + void trim_maps(epoch_t oldest, bool skip_maps); void note_down_osd(int osd); void note_up_osd(int osd); friend struct C_OnMapCommit;