HomePhabricator

fix possible block db breakage during re-index
bb6acff07982Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

fix possible block db breakage during re-index

When re-indexing, there are a few cases where garbage data may be skipped in
the block files. In these cases, the indices are correctly written to the index
db, however the pointer to the next position for writing in the current block
file is calculated by adding the sizes of the valid blocks found.

As a result, when the re-index is finished, the index db is correct for all
existing blocks, but the next block will be written to an incorrect offset,
likely overwriting existing blocks.

Rather than using the sum of all valid blocks to determine the next write
position, use the end of the last block written to the file. Don't assume that
the current block is the last one in the file, since they may be read
out-of-order.

Details

Provenance
Cory Fields <cory-nospam-@coryfields.com>Authored on Mar 7 2015, 01:26
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGING7c3fbc34aed5: Merge pull request #5510
Branches
Unknown
Tags
Unknown

Event Timeline

Cory Fields <cory-nospam-@coryfields.com> committed rSTAGINGbb6acff07982: fix possible block db breakage during re-index (authored by Cory Fields <cory-nospam-@coryfields.com>).Mar 10 2015, 17:59