doc: Fix log message for -reindex #19600

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:200727-load-log changing 1 files +1 −1
  1. hebasto commented at 5:43 pm on July 27, 2020: member

    During -reindex in the following log messages:

    02020-07-27T15:33:17Z [loadblk] Reindexing block file blk02155.dat...
    12020-07-27T15:33:19Z [loadblk] Loaded 0 blocks from external file in 1170ms
    22020-07-27T15:33:19Z [loadblk] Reindexing block file blk02156.dat...
    32020-07-27T15:33:20Z [loadblk] Loaded 0 blocks from external file in 1221ms
    42020-07-27T15:33:20Z [loadblk] Reindexing block file blk02157.dat...
    52020-07-27T15:33:27Z [loadblk] Loaded 609 blocks from external file in 7214ms
    

    the latest one is clearly wrong as all of the “loaded 609 blocks” are not from the blk02157.dat file. Some of them belong to the previously processed *.dat files.

    With this PR these messages will look like:

    02020-07-27T15:33:20Z [loadblk] Reindexing block file blk02157.dat...
    12020-07-27T15:33:27Z [loadblk] Processed block file. Loaded 609 blocks in 7214ms
    

    This was done while reviewing #16981.

  2. doc: Fix log message for -reindex
    Loaded blocks could be not from the just processed file.
    cdbfe752d8
  3. DrahtBot added the label Docs on Jul 27, 2020
  4. DrahtBot added the label Validation on Jul 27, 2020
  5. promag commented at 7:42 pm on July 28, 2020: member

    Maybe log after

    https://github.com/bitcoin/bitcoin/blob/5ea6e50fc40af0779bfc74b285b0a4f8c20d020c/src/init.cpp#L702-L703

    And LoadExternalBlockFile could return loaded blocks?

  6. promag commented at 7:43 pm on July 28, 2020: member
    Concept ACK.
  7. hebasto commented at 7:49 am on July 29, 2020: member

    @promag

    Maybe log after

    https://github.com/bitcoin/bitcoin/blob/5ea6e50fc40af0779bfc74b285b0a4f8c20d020c/src/init.cpp#L702-L703

    And LoadExternalBlockFile could return loaded blocks?

    LoadExternalBlockFile() has two call sites within ThreadImport(). And your suggestion makes diff bigger than current one line.

  8. laanwj commented at 10:39 am on August 2, 2020: member
    Concept ACK on improving the message, though I’m not sure the distinction between “block file” and “external file” (which is also a block file) is clear enough, it still feels somewhat confusing to me.
  9. hebasto commented at 11:01 am on August 2, 2020: member

    @laanwj

    Concept ACK on improving the message, though I’m not sure the distinction between “block file” and “external file” (which is also a block file) is clear enough, it still feels somewhat confusing to me.

    The intention was to refer a “block file” which is located in blocksdir and is processed during --reindex; and an external file is specified by -loadblock option.

  10. DrahtBot commented at 1:14 am on August 6, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16981 (Improve runtime performance of –reindex by LarryRuane)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. LarryRuane commented at 2:26 pm on August 7, 2020: contributor

    This is a good change, concept ACK. I think the message could be simplified slightly:

    0  2020-07-27T15:33:20Z [loadblk] Reindexing block file blk02157.dat...
    1- 2020-07-27T15:33:27Z [loadblk] Processed block file. Loaded 609 blocks in 7214ms
    2+ 2020-07-27T15:33:27Z [loadblk] Loaded 609 blocks in 7214ms
    

    #16981 will propose changing it to this, which you could do in this PR instead if you’d like since you’re touching this code:

    02020-07-27T15:33:27Z [loadblk] Processed block file. Loaded 609 blocks in 7214ms pending 402 blocks
    

    where 402 is mapBlocksUnknownParent.size(). It’s fun to watch that number go up and down :grin:. Plus, if increases rapidly, you know that a block is missing, although you’d also know that by Loaded 0 blocks.

  12. hebasto commented at 3:40 pm on August 7, 2020: member
    Closing in favor of #16981.
  13. hebasto closed this on Aug 7, 2020

  14. DrahtBot locked this on Feb 15, 2022

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: 2024-07-05 19:13 UTC

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