Unexpected file pre-allocation during -reindex-chainstate #19459

issue hebasto opened this issue on July 7, 2020
  1. hebasto commented at 11:25 AM on July 7, 2020: member

    Running bitcoind -reindex-chainstate one could see in the debug.log:

    2020-07-07T11:22:08Z Leaving block file 96: CBlockFileInfo(blocks=534, size=134102608, heights=271294...272192, time=2013-11-24...2013-11-29)
    2020-07-07T11:22:09Z Pre-allocating up to position 0x1000000 in blk00097.dat
    2020-07-07T11:22:09Z Pre-allocating up to position 0x100000 in rev00097.dat
    

    Is file pre-allocation required if *.dat files are not corrupted?

  2. mruddy commented at 12:41 PM on April 18, 2022: contributor

    Hi, I don't see the issue here. See BlockManager::FindBlockPos. You have the "Leaving block file" message which means that it was a newly processed block. In adding this new block, the code noticed that blk file 96 would go over its 128 MiB size limit, so it finalized file 96 and went to new file 97. Part of that normal process is allocating the new file in 16 MiB chunks. This in itself has nothing to do with corruption. If you think there is some corruption involved, then there must be more context not mentioned in this issue.

  3. fanquake commented at 3:29 PM on February 7, 2023: member

    Guess this can be re-opened if there is anything further to discuss.

  4. fanquake closed this on Feb 7, 2023

  5. bitcoin locked this on Feb 7, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me