From: Radosław Zarzyński Date: Wed, 15 Jun 2022 15:19:30 +0000 (+0200) Subject: osd: trim dups regardless of their versions X-Git-Tag: v18.0.0~161^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=aada08acde7a05ad769bb7a886ebcece628d522c;p=ceph-ci.git osd: trim dups regardless of their versions Fixes: https://tracker.ceph.com/issues/53729 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index d7ab12c01df..c61e819f908 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -131,10 +131,18 @@ void PGLog::IndexedLog::trim( } } - while (!dups.empty()) { + // we can hit an inflated `dups` b/c of https://tracker.ceph.com/issues/53729 + // the idea is to slowly trim them over a prolonged period of time and mix + // omap deletes with writes (if we're here, a new log entry got added) to + // neither: 1) blow size of single Transaction nor 2) generate-n-accumulate + // large amount of tombstones in BlueStore's RocksDB. + // if trimming immediately is a must, then the ceph-objectstore-tool is + // the way to go. + const size_t max_dups = cct->_conf->osd_pg_log_dups_tracked; + for (size_t max_dups_to_trim = cct->_conf->osd_pg_log_trim_max; + max_dups_to_trim > 0 && dups.size() > max_dups; + max_dups_to_trim--) { const auto& e = *dups.begin(); - if (e.version.version >= earliest_dup_version) - break; lgeneric_subdout(cct, osd, 20) << "trim dup " << e << dendl; if (trimmed_dups) trimmed_dups->insert(e.get_key_name());