From: xie xingguo Date: Thu, 12 Mar 2020 10:01:45 +0000 (+0800) Subject: osd/PeeringState: do not trim pg log past last_update_ondisk X-Git-Tag: v15.2.2~33^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e605b00eb48dc6ae0f61252dad3721e0739d02b;p=ceph.git osd/PeeringState: do not trim pg log past last_update_ondisk Trimming past last_update_ondisk would be really bad, e.g., a new interval change would cancel&redo a previous op, and if we trim past last_update_ondisk, there could be potential object inconsistencies as log merging won't necessarily be able to find all divergent entries later (we lost track of the unfinished op that should really be reverted). Fixes: https://tracker.ceph.com/issues/44532 Signed-off-by: xie xingguo (cherry picked from commit eef1928e0153f09dc2522bb885b0ad9f5c65f4bd) --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 10ffec25291..5a49aaf4514 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -4093,9 +4093,10 @@ void PeeringState::calc_trim_to_aggressive() size_t target = pl->get_target_pg_log_entries(); // limit pg log trimming up to the can_rollback_to value - eversion_t limit = std::min( + eversion_t limit = std::min({ pg_log.get_head(), - pg_log.get_can_rollback_to()); + pg_log.get_can_rollback_to(), + last_update_ondisk}); psdout(10) << __func__ << " limit = " << limit << dendl; if (limit != eversion_t() &&