Skip to content

Commit

Permalink
osd/PGLog: preserve original_crt in proc_replica_log()
Browse files Browse the repository at this point in the history
This is to prevent rolling back further than deleted object version.

Signed-off-by: Neha Ojha <nojha@redhat.com>
  • Loading branch information
neha-ojha committed Mar 25, 2019
1 parent de18c59 commit cd25c1d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/osd/PGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,19 @@ void PGLog::proc_replica_log(
limit :
first_non_divergent->version;

// We need to preserve the original crt before it gets updated in rewind_from_head().
// Later, in merge_object_divergent_entries(), we use it to check whether we can rollback
// a divergent entry or not.
eversion_t original_crt = log.get_can_rollback_to();
dout(20) << __func__ << " original_crt = " << original_crt << dendl;
IndexedLog folog(olog);
auto divergent = folog.rewind_from_head(lu);
_merge_divergent_entries(
folog,
divergent,
oinfo,
olog.get_can_rollback_to(),
olog.get_can_rollback_to(),
original_crt,
omissing,
0,
this);
Expand Down

0 comments on commit cd25c1d

Please sign in to comment.