log: LogError with FlatFilePos in UndoReadFromDisk #30428

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2407-log-err-undo changing 2 files +12 −18
  1. maflcko commented at 2:37 pm on July 11, 2024: member

    These errors should never happen in normal operation. If they do, knowing the FlatFilePos may be useful to determine if data corruption happened. Also, handle the error pos.IsNull() as part of OpenUndoFile, because it may as well have happened due to data corruption.

    This mirrors the LogError behavior from ReadBlockFromDisk.

    Also, two other fixup commits in this module.

  2. refactor: Mark IsBlockPruned const
    Member fields are used read-only in this method.
    aaaa3323f3
  3. log: LogError with FlatFilePos in UndoReadFromDisk
    These errors should never happen in normal operation. If they do,
    knowing the FlatFilePos may be useful to determine if data corruption
    happened. Also, handle the error pos.IsNull() as part of OpenUndoFile,
    because it may as well have happened due to data corruption.
    
    This mirrors the LogError behavior from ReadBlockFromDisk.
    fad59a2f0f
  4. log: Fix __func__ in LogError in blockstorage module
    These errors should never happen. However, when they do happen, it is
    useful to log the correct error location (function name).
    
    For example, this fixes an incorrect "ConnectBlock()" in
    "WriteUndoDataForBlock".
    fa14e1d9d5
  5. DrahtBot commented at 2:37 pm on July 11, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK kevkevinpal, tdb3, ryanofsky

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #30364 (logging: Replace LogError and LogWarning with LogAlert by ryanofsky)
    • #27006 (reduce cs_main scope, guard block index ’nFile’ under a local mutex by furszy)

    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.

  6. DrahtBot renamed this:
    log: LogError with FlatFilePos in UndoReadFromDisk
    log: LogError with FlatFilePos in UndoReadFromDisk
    on Jul 11, 2024
  7. DrahtBot added the label Utils/log/libs on Jul 11, 2024
  8. kevkevinpal commented at 0:21 am on July 12, 2024: contributor

    ACK fa14e1d

    I think this makes sense and mirroring ReadBlockFromDisk seems reasonable to me

  9. tdb3 approved
  10. tdb3 commented at 3:02 am on July 12, 2024: contributor
    cr and light test ACK fa14e1d9d5c5dc44396a01583ae94480b7bc29ee
  11. ryanofsky approved
  12. ryanofsky commented at 4:38 pm on July 15, 2024: contributor
    Code review ACK fa14e1d9d5c5dc44396a01583ae94480b7bc29ee. This should make logging clearer and more consistent
  13. ryanofsky merged this on Jul 15, 2024
  14. ryanofsky closed this on Jul 15, 2024

  15. maflcko deleted the branch on Jul 16, 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: 2024-11-21 09:12 UTC

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