db: warn about legacy chainstate table format #35467

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/warn-legacy-chainstate-layout changing 4 files +53 −2
  1. l0rinc commented at 11:16 AM on June 5, 2026: contributor

    Problem: Chainstates created by pre-29 nodes can contain thousands of files from the old 2 MiB LevelDB table target. Now that the mmap limit dropped back to 1000 and seek compaction was disabled, continuing IBD from such a chainstate can leave many reads on the non-mmap path until the database is compacted. A current 32 MiB-layout chainstate had 6 matching small files, while pre-29 chainstates can have more than 6000, so a coarse threshold gives users a warning without flagging normal current layouts.

    Fix: Warn at startup when the chainstate database has more than 100 small files and point users to -forcecompactdb.

    Fixes #35457

  2. db: warn on legacy chainstate format
    Chainstates created by pre-29 nodes can contain thousands of files from the old 2 MiB LevelDB table target.
    After the mmap limit dropped back to 1000 and seek compaction was disabled, continuing IBD from such a chainstate can leave many table reads on the non-mmap path until the database is compacted.
    
    Warn at startup when the chainstate database has more than 100 small files and point users to `-forcecompactdb`.
    The threshold is deliberately coarse: a current 32 MiB-layout chainstate had 6 matching files, while pre-29 chainstates can have more than 6000.
    
    Co-authored-by: Andrew Toth <andrewstoth@gmail.com>
    Co-authored-by: Will Clark <will@256k1.dev>
    1ae426fe65
  3. DrahtBot added the label UTXO Db and Indexes on Jun 5, 2026
  4. DrahtBot commented at 11:16 AM on June 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35467.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34937 (Fix startup failure with RLIM_INFINITY fd limits by Sjors)
    • #34132 (coins: drop error catcher, centralize fatal read handling by l0rinc)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. DrahtBot added the label CI failed on Jun 5, 2026

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-06-07 06:51 UTC

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