Reindex fails #28346

issue pbies openend this issue on August 26, 2023
  1. pbies commented at 10:40 pm on August 26, 2023: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Currently with over 800k blocks, when dbcache is set to 24 GB, reindexing the blockchain with txindex=1 at 16 GB of cache used Bitcoin Core hangs.

    Expected behaviour

    Bitcoin Core should be able to use more than 16 GB of dbcache and shouldn’t hang forever when reindexing.

    Steps to reproduce

    Download whole blockchain, set txindex=1, restart Core with -reindex option.

    Relevant log output

    Information about dbcache being used fully.

    How did you obtain Bitcoin Core

    Pre-built binaries

    What version of Bitcoin Core are you using?

    25.0.0

    Operating system and version

    Microsoft Windows [Version 10.0.19045.3393]

    Machine specifications

    CPU 9900K @ max 5 GHz 16 GB RAM 4000 MHz SSD drives GPU 1080 Ti

  2. maflcko added the label Windows on Aug 27, 2023
  3. maflcko added the label Resource usage on Aug 27, 2023
  4. maflcko commented at 6:56 am on August 27, 2023: member

    dbcache is set to 24 GB

    16 GB RAM 4000 MHz

    You can’t set a dbcache max memory usage higher than the available memory on your system.

    Maybe there should be an Init error on such cases?

  5. pbies commented at 2:05 pm on August 27, 2023: none

    dbcache is set to 24 GB

    16 GB RAM 4000 MHz

    You can’t set a dbcache max memory usage higher than the available memory on your system.

    Maybe there should be an Init error on such cases?

    I have 1 TB of swapfile available.

    And as I can see in source code there is limit to 16 GB, imprinted.

  6. maflcko removed the label Windows on Aug 27, 2023
  7. maflcko added the label UTXO Db and Indexes on Aug 27, 2023
  8. sipa commented at 2:16 pm on August 27, 2023: member
    The dbcache value cannot be set higher than 16384. See also https://github.com/bitcoin/bitcoin/issues/28249
  9. pbies commented at 2:24 pm on August 27, 2023: none

    The dbcache value cannot be set higher than 16384. See also #28249

    Yes, that’s true and now for reindexing the value should be higher as dbcache raises to 16 GB and hangs Bitcoin Core.

  10. sipa commented at 2:39 pm on August 27, 2023: member
    How long does it hang? Writing out 16 GB of database operations can take several minutes. Alternatively, it may appear to stall just because it’s starting to thrash your swap space once you exceed the available actual RAM.
  11. pbies commented at 2:55 pm on August 27, 2023: none

    How long does it hang? Writing out 16 GB of database operations can take several minutes. Alternatively, it may appear to stall just because it’s starting to thrash your swap space once you exceed the available actual RAM.

    I waited few minutes and then killed Core. Swap space as I have seen wasn’t used.

    Anyway it does not matter, Core just needs to make maximum dbcache larger. I suggest 32 GB to make it work for few next years.

  12. sipa commented at 2:58 pm on August 27, 2023: member

    Yes, there is an issue about that already, #28249. Let’s move that part of the discussion there.

    But Bitcoin Core hanging is an independent issue. If it’s actually hanging, that’s a bug. If it’s just slow, which is certainly possible with such huge caches, then it’s possibly expected.

  13. sipa commented at 3:21 pm on August 27, 2023: member
    Did anything appear in debug.log while Bitcoin Core appeared to hang?
  14. pbies commented at 3:25 pm on August 27, 2023: none

    Did anything appear in debug.log while Bitcoin Core appeared to hang?

    Yes: last message was something like dbcache crossed past allowed value of maximum memory and was two values given in bytes about 16 GiB.

  15. sipa commented at 3:27 pm on August 27, 2023: member
    That means it started flushing the whole 16 GiB worth of database changes to disk. I’d recommend waiting longer for it to finish. How long will depend on your setup, but probably not more than a few minutes. If it doesn’t complete in say an hour, report back and we can investigate further.
  16. pbies commented at 3:30 pm on August 27, 2023: none

    That means it started flushing the whole 16 GiB worth of database changes to disk. I’d recommend waiting longer for it to finish. How long will depend on your setup, but probably not more than a few minutes. If it doesn’t complete in say an hour, report back and we can investigate further.

    Ok, will do that next time. This does not cancel idea to make dbcache max size larger to be possibly set.

  17. maflcko added the label Waiting for author on Aug 27, 2023
  18. maflcko commented at 7:04 am on August 29, 2023: member
    Closing for now, but please let us know once and if you have more details
  19. maflcko closed this on Aug 29, 2023

  20. bitcoin locked this on Aug 28, 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-10-31 03:12 UTC

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