From 0e57c101c9dd51ee3a84123c96e626799ab6d21e Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Thu, 16 Aug 2018 11:48:19 -0700 Subject: [PATCH] osd/PrimaryLogPG.cc: limit trimming at can_rollback_to This change is motivated by the failures seen in the multimds suite, where we hit assert(s <= can_rollback_to), while trimming the log in ec pools. This is due to the fact that we had removed limits on the trim_to value to address https://tracker.ceph.com/issues/23979. But, seems that this could be dangerous for ec pools. So, keep the can_rollback_to limit, while calculating the trim_to value. Fixes: http://tracker.ceph.com/issues/21416 Signed-off-by: Neha Ojha (cherry picked from commit 4b5c6b88d444e2173e716fe4890717873c8dc8e5) --- src/osd/PrimaryLogPG.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 8314edf1554d2..987e2b94097f4 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1567,8 +1567,10 @@ void PrimaryLogPG::calc_trim_to() PG_STATE_BACKFILL_TOOFULL)) { target = cct->_conf->osd_max_pg_log_entries; } - // limit pg log trimming up to the head of the log - eversion_t limit = pg_log.get_head(); + // limit pg log trimming up to the can_rollback_to value + eversion_t limit = std::min( + pg_log.get_head(), + pg_log.get_can_rollback_to()); dout(10) << __func__ << " limit = " << limit << dendl; if (limit != eversion_t() && -- 2.39.5