PG::merge_old_entry: fix case for divergent prior_version

Previously, we asserted that a log entry with a divergent
prior_version must be a clone.  Consider the following
case:

6'11(6'2)  m foo
7'12(6'3) m bar
7'13(7'12) m bar

If this is merged with:

6'11(6'2)  m foo
8'12(6'4) m baz

we will hit the assert.  The correct behavior is simply to remove
the object as in the clone case.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Samuel Just 2012-11-02 14:13:33 -07:00 committed by Sage Weil
parent 7e264678a9
commit 342c2c7077

View File

@ -384,9 +384,8 @@ bool PG::merge_old_entry(ObjectStore::Transaction& t, pg_log_entry_t& oe)
}
}
} else if (oe.prior_version > info.log_tail) {
assert(oe.soid.snap != CEPH_NOSNAP);
dout(20) << "merge_old_entry had " << oe
<< ", clone with no non-divergent log entries, "
<< ", object with no non-divergent log entries, "
<< "deleting" << dendl;
remove_object_with_snap_hardlinks(t, oe.soid);
if (missing.is_missing(oe.soid))