]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG.cc: limit trimming at can_rollback_to
authorNeha Ojha <nojha@redhat.com>
Thu, 16 Aug 2018 18:48:19 +0000 (11:48 -0700)
committerNeha Ojha <nojha@redhat.com>
Thu, 30 Aug 2018 21:36:04 +0000 (17:36 -0400)
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 <nojha@redhat.com>
(cherry picked from commit 4b5c6b88d444e2173e716fe4890717873c8dc8e5)

src/osd/PrimaryLogPG.cc

index 8314edf1554d276a9af04ce6edbd2fda37878879..987e2b94097f4105c342ec7ab552d8cac3bcf1d5 100644 (file)
@@ -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() &&