Pruning code does not currently prune #6184

issue BitPopCoin openend this issue on May 25, 2015
  1. BitPopCoin commented at 5:25 pm on May 25, 2015: none

    This one downloads the entire blockchain before pruning and destroys my vps, debug sees my 25gb limit as usual but it just continues. I can’t finish but it does hit 30gb before killing my vps.

    http://builds.jonasschnelli.ch/nightlybuilds/2015-05-17/bitcoin-0.10.99-linux64.tar.gz

  2. BitPopCoin commented at 5:28 pm on May 25, 2015: none
  3. jonasschnelli commented at 5:51 pm on May 25, 2015: contributor
    @BitpopCoin Can you post your debug.log? What -prune=-target did you set?
  4. BitPopCoin commented at 6:55 pm on May 25, 2015: none

    Bitcoin.conf prune=25000

    I deleted the debug, I can try again if you think it should be working and it’s on my end.

  5. BitPopCoin commented at 7:23 pm on May 25, 2015: none

    It had

    Autoprune configured to use less than 25000MiB on disk for block files

  6. jonasschnelli commented at 7:27 pm on May 25, 2015: contributor
    @BitpopCoin you are aware of that the 25GiB are only for the blockstore (not including utxo set which should be around 761MB, etc.)?
  7. BitPopCoin commented at 7:49 pm on May 25, 2015: none
    Yes the working version hits 26gb which is fine.
  8. laanwj closed this on May 26, 2015

  9. BitPopCoin commented at 5:38 pm on May 27, 2015: none

    I still have the issue. I tried the latest snapshot.

    Xxx

  10. jonasschnelli commented at 6:08 pm on May 27, 2015: contributor
    Thanks for the log. Could you run again with -debug=prune and upload the debug.log again?
  11. BitPopCoin commented at 1:46 am on May 28, 2015: none
  12. jonasschnelli commented at 10:43 am on May 28, 2015: contributor

    @laanwj i think this should get reopened. It looks after a real issue: Found the following in the logs (partial output of | grep prune):

     02015-05-28 01:13:12 Prune: target=2500MiB actual=2462MiB diff=37MiB max_prune_height=197394 removed 0 blk/rev pairs
     12015-05-28 01:13:14 Prune: target=2500MiB actual=2463MiB diff=36MiB max_prune_height=197504 removed 0 blk/rev pairs
     22015-05-28 01:13:16 Prune: target=2500MiB actual=2470MiB diff=29MiB max_prune_height=197587 removed 0 blk/rev pairs
     32015-05-28 01:13:16 Prune: target=2500MiB actual=2471MiB diff=28MiB max_prune_height=197593 removed 0 blk/rev pairs
     42015-05-28 01:13:19 Prune: target=2500MiB actual=2486MiB diff=13MiB max_prune_height=197687 removed 0 blk/rev pairs
     52015-05-28 01:13:19 Prune: target=2500MiB actual=2487MiB diff=12MiB max_prune_height=197688 removed 0 blk/rev pairs
     62015-05-28 01:13:21 Prune: target=2500MiB actual=2503MiB diff=-3MiB max_prune_height=197699 removed 0 blk/rev pairs
     72015-05-28 01:13:23 Prune: target=2500MiB actual=2520MiB diff=-20MiB max_prune_height=197744 removed 0 blk/rev pairs
     82015-05-28 01:13:24 Prune: target=2500MiB actual=2526MiB diff=-26MiB max_prune_height=197788 removed 0 blk/rev pairs
     92015-05-28 01:13:26 Prune: target=2500MiB actual=2527MiB diff=-27MiB max_prune_height=197876 removed 0 blk/rev pairs
    102015-05-28 01:13:28 Prune: target=2500MiB actual=2530MiB diff=-30MiB max_prune_height=197967 removed 0 blk/rev pairs
    112015-05-28 01:13:29 Prune: target=2500MiB actual=2532MiB diff=-32MiB max_prune_height=198042 removed 0 blk/rev pairs
    
  13. laanwj commented at 10:46 am on May 28, 2015: member
    @jonasschnelli Fine with reopening, but then the issue should get a relevant title
  14. laanwj reopened this on May 28, 2015

  15. jonasschnelli commented at 10:48 am on May 28, 2015: contributor
    @BitpopCoin: could you rename the issue title? Something that reflects the problem.
  16. sdaftuar commented at 1:05 pm on May 28, 2015: member

    @BitpopCoin Thanks for reporting this; I think I see the problem.

    The pruning code enforces a requirement that the block files it keeps be contiguous, so that blockfile N will only be considered for pruning if blockfiles 0, …, N-1 were already pruned.

    There is also a requirement that no block file will be pruned if there’s a block in the file with a height that is too close to the height of the tip. What appears to be happening here is that some peer likely inv’ed you a block at the tip while you were syncing (this is normal behavior); that block was stored in block file 5, and since its height is so large, it effectively stops pruning from taking place. From the debug.log:

    2015-05-28 01:03:59 Leaving block file 5: CBlockFileInfo(blocks=7446, size=134174305, heights=148758...358316, time=2011-10-10...2015-05-28)

    For what it’s worth, if the node were able to fully sync, I believe eventually the pruning targets would be respected again. This is certainly undesirable behavior though.

    I think the best fix may be to relax the restriction that files be contiguous, which will complicate the logic slightly but seems likely to be worth it to avoid this outcome.

  17. BitPopCoin renamed this:
    http://builds.jonasschnelli.ch/nightlybuilds/
    Pruning code does not currently prune
    on May 28, 2015
  18. BitPopCoin commented at 5:59 pm on May 28, 2015: none

    For what it’s worth, I’ve tried it many times. Last few times I’ve used 2.5 gb to speed things up. But I’ve originally used 25gb and it continues past 30gb breaking my droplet.

    I think pruning will be used for limited disks and going over at all will break things. Can you add a quit for now? So when I do test I don’t have to spend an extra hour imaging the machine and restoring because the disk filled up and other things could have broke.

    I run many nodes and upgrading will double my costs so I need pruning. I was going to move to vultr large storage but they don’t have imaging. Thanks guys.

  19. ajweiss commented at 11:19 pm on May 28, 2015: contributor
    Indeed, there appears to be a bug here. Just out of curiosity, are you using the relay network client with your pruned nodes? I was able to reproduce something similar locally using the relay network during initial sync.
  20. BitPopCoin commented at 0:38 am on May 29, 2015: none

    Yes the relay node is connected.

    addnode=public.us-west.relay.mattcorallo.com:8335

  21. ajweiss commented at 1:04 am on May 29, 2015: contributor

    Good. That makes sense. I was wondering how a failure like this would have slipped through all the testing that has taken place thus far. There is definitely a bug here and there are a few routes for fixing it with varying levels of risk. There will be a patch forthcoming.

    In the meantime, if you want to test pruning, disable the relay node during initial sync (and catchup syncs if your nodes go offline, or just altogether). It’s a difficult to trigger corner case if the relay node isn’t involved.

    Thanks for reporting!

  22. BitPopCoin commented at 2:13 am on May 29, 2015: none

    I was trying to think of anything odd about my node but I kept only thinking about the permissions. Another Bitcoin created .bitcoin but it ran as root and could write so I ignored the permissions issue, which was correct but I forgot I was using the relay network.

    I’ll wait to try it again until a possible patch so let me know and I’ll test. I went back to Luke’s version but it’s getting old. Thanks.

  23. laanwj added the label Bug on May 29, 2015
  24. laanwj commented at 10:25 am on June 10, 2015: member
    Can you help testing #6221? It should solve this issue by also pruning when blocks are non-contiguous.
  25. BitPopCoin commented at 10:34 am on June 10, 2015: none
    I tried the nightly on 6-5 which didn’t help. Should I try tonight’s?
  26. BitPopCoin commented at 11:16 am on June 10, 2015: none
  27. sdaftuar commented at 12:07 pm on June 10, 2015: member
    FYI #6221 hasn’t been merged yet, so that build won’t help (I believe that’s just what was in master).
  28. jonasschnelli commented at 12:15 pm on June 10, 2015: contributor
    Just started a build for #6221 (https://builds.jonasschnelli.ch/pulls/6221/). @BitpopCoin: you should test this build. It’s the master with 6221 on top. Ready in about 30mins.
  29. sdaftuar commented at 12:22 pm on June 10, 2015: member
    @jonasschnelli Thanks! Also if you and @BitpopCoin are up for it, #6224 goes further to make pruning more effective when using the relay node.
  30. BitPopCoin commented at 12:54 pm on June 10, 2015: none
    Ok will both be in today? I already started, I’ll stop and wait. Thanks.
  31. BitPopCoin commented at 1:08 pm on June 10, 2015: none
  32. BitPopCoin commented at 0:53 am on June 11, 2015: none
    It worked! Will you tell me when it’s in the nightly then the rc?
  33. laanwj commented at 12:55 pm on June 16, 2015: member
    It has been merged into master so it will be in any nightlies from ~ 5 days ago, and it has been backported to 0.11 so will also be in next rc (rc2).
  34. laanwj closed this on Jun 16, 2015

  35. BitPopCoin commented at 5:30 am on June 17, 2015: none
    Thanks guys, great work
  36. DrahtBot locked this on Sep 8, 2021

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 06:12 UTC

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