Do not skip garbage entries on start (rollback change from 3.0.4)
This commit is contained in:
@@ -334,19 +334,12 @@ corrupted_block:
|
|||||||
block_num, block_offset, wr->size, sizeof(heap_entry_t));
|
block_num, block_offset, wr->size, sizeof(heap_entry_t));
|
||||||
goto corrupted_block;
|
goto corrupted_block;
|
||||||
}
|
}
|
||||||
if (wr->is_garbage())
|
// Garbage collection is only performed when writing new entries into the block
|
||||||
{
|
// because it needs a fake LSN and modified blocks require consecutive modified LSNs
|
||||||
// Garbage collection is only performed when writing new entries into the block
|
// At the same time, further modifications _after_ putting new entries into the block,
|
||||||
// because it needs a fake LSN and modified blocks require consecutive modified LSNs
|
// but _before_ writing it, may mark some entries in it as garbage. That's why garbage
|
||||||
// That's why garbage entries may persist on disk
|
// entries may still be present on disk.
|
||||||
if (log_level > 5)
|
wr->entry_type &= ~BS_HEAP_GARBAGE;
|
||||||
{
|
|
||||||
fprintf(stderr, "Notice: skipping garbage entry %jx:%jx v%ju l%ju in metadata block %u at %u\n",
|
|
||||||
wr->inode, wr->stripe, wr->version, wr->lsn, block_num, block_offset);
|
|
||||||
}
|
|
||||||
block_offset += wr->size;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ((wr->entry_type & BS_HEAP_TYPE) < BS_HEAP_BIG_WRITE ||
|
if ((wr->entry_type & BS_HEAP_TYPE) < BS_HEAP_BIG_WRITE ||
|
||||||
(wr->entry_type & BS_HEAP_TYPE) > BS_HEAP_ROLLBACK ||
|
(wr->entry_type & BS_HEAP_TYPE) > BS_HEAP_ROLLBACK ||
|
||||||
(wr->entry_type & ~(BS_HEAP_TYPE|BS_HEAP_STABLE)) ||
|
(wr->entry_type & ~(BS_HEAP_TYPE|BS_HEAP_STABLE)) ||
|
||||||
|
|||||||
@@ -1893,7 +1893,8 @@ void test_big_intent_csums()
|
|||||||
heap.finish_recheck();
|
heap.finish_recheck();
|
||||||
|
|
||||||
auto mod = heap.get_recheck_modified_blocks();
|
auto mod = heap.get_recheck_modified_blocks();
|
||||||
assert(mod.size() == 0);
|
assert(mod.size() == 1);
|
||||||
|
assert(mod[0] == 0);
|
||||||
|
|
||||||
// read object 1 - big_intent should be there
|
// read object 1 - big_intent should be there
|
||||||
object_id oid = { .inode = INODE_WITH_POOL(1, 1), .stripe = 0 };
|
object_id oid = { .inode = INODE_WITH_POOL(1, 1), .stripe = 0 };
|
||||||
|
|||||||
Reference in New Issue
Block a user