Skip to content

Commit

Permalink
osd/PeeringState: do not trim pg log past last_update_ondisk
Browse files Browse the repository at this point in the history
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 <xie.xingguo@zte.com.cn>
(cherry picked from commit eef1928)

Conflicts:
	src/osd/PeeringState.cc
- changes applied manually in src/osd/PrimaryLogPG.cc
  • Loading branch information
xiexingguo authored and smithfarm committed May 7, 2020
1 parent 3ad2dfa commit b670715
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osd/PrimaryLogPG.cc
Expand Up @@ -1663,9 +1663,10 @@ void PrimaryLogPG::calc_trim_to_aggressive()
target = cct->_conf->osd_max_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});
dout(10) << __func__ << " limit = " << limit << dendl;

if (limit != eversion_t() &&
Expand Down

0 comments on commit b670715

Please sign in to comment.