From: Neha Ojha Date: Thu, 16 Aug 2018 18:48:19 +0000 (-0700) Subject: osd/PrimaryLogPG.cc: limit trimming at can_rollback_to X-Git-Tag: v13.2.2~50^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23403%2Fhead;p=ceph.git 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) --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2393e482803d..ab78c339664a 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1624,8 +1624,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() &&