Skip to content

Commit

Permalink
Merge pull request ceph#6801 from athanatos/wip-13965
Browse files Browse the repository at this point in the history
Wip 13965

Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
athanatos committed Jan 8, 2016
2 parents efdef31 + 053ee91 commit cd29479
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/osd/PGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead
if (info.last_complete > newhead)
info.last_complete = newhead;

if (log.rollback_info_trimmed_to > newhead)
log.rollback_info_trimmed_to = newhead;

log.index();

map<eversion_t, hobject_t> new_priors;
Expand Down
34 changes: 34 additions & 0 deletions src/test/osd/TestPGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,40 @@ TEST_F(PGLogTest, rewind_divergent_log) {
EXPECT_TRUE(dirty_info);
EXPECT_TRUE(dirty_big_info);
}

// Test for 13965
{
clear();

ObjectStore::Transaction t;
list<hobject_t> remove_snap;
pg_info_t info;
info.log_tail = log.tail = eversion_t(1, 5);
info.last_update = eversion_t(1, 6);
bool dirty_info = false;
bool dirty_big_info = false;

{
pg_log_entry_t e;
e.mod_desc.mark_unrollbackable();
e.version = eversion_t(1, 5);
e.soid.set_hash(0x9);
add(e);
}
{
pg_log_entry_t e;
e.mod_desc.mark_unrollbackable();
e.version = eversion_t(1, 6);
e.soid.set_hash(0x10);
add(e);
}
TestHandler h(remove_snap);
trim_rollback_info(eversion_t(1, 6), &h);
rewind_divergent_log(t, eversion_t(1, 5), info, &h,
dirty_info, dirty_big_info);
pg_log_t log;
claim_log_and_clear_rollback_info(log, &h);
}
}

TEST_F(PGLogTest, merge_old_entry) {
Expand Down

0 comments on commit cd29479

Please sign in to comment.