bsc icon indicating copy to clipboard operation
bsc copied to clipboard

How prune data now ?

Open yo31400 opened this issue 4 years ago • 7 comments

how prune data now ? prune-state no longer works on the latest version and when I run the command "./geth snapshot prune-block --datadir ./node --datadir.ancient ./chaindata/ancient" it deleted all my ancient folder, I had to start on a new snapshot. What is the new command to prune the data now ?

yo31400 avatar Jan 30 '22 20:01 yo31400

Old prune-state is working for me with 1.1.8. Command: ./geth --config ./config.toml --datadir ./node snapshot prune-state --bloomfilter.size 20000 But with new prune block ./geth snapshot prune-block --datadir ./node --datadir.ancient ./chaindata/ancient - same issue, it deleted all ancient blocks, and the error was "File is currently in use". System - Windows 10.

Vladis432 avatar Jan 31 '22 20:01 Vladis432

how prune data now ? prune-state no longer works on the latest version and when I run the command "./geth snapshot prune-block --datadir ./node --datadir.ancient ./chaindata/ancient" it deleted all my ancient folder, I had to start on a new snapshot. What is the new command to prune the data now ?

Yes same problem issued for me my ancient data all is gone just for 1.2 sec. now its running infinite loop like this. t=2022-02-07T06:10:31+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:10:31+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144 t=2022-02-07T06:10:38+0000 lvl=info msg="Snap sync requested, enabling --snapshot" t=2022-02-07T06:10:38+0000 lvl=info msg="Set global gas cap" cap=25,000,000 t=2022-02-07T06:10:38+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:10:38+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144 t=2022-02-07T06:10:44+0000 lvl=info msg="Snap sync requested, enabling --snapshot" t=2022-02-07T06:10:44+0000 lvl=info msg="Set global gas cap" cap=25,000,000 t=2022-02-07T06:10:44+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:10:44+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144 t=2022-02-07T06:11:41+0000 lvl=info msg="Snap sync requested, enabling --snapshot" t=2022-02-07T06:11:41+0000 lvl=info msg="Set global gas cap" cap=25,000,000 t=2022-02-07T06:11:41+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:11:41+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144 t=2022-02-07T06:11:47+0000 lvl=info msg="Snap sync requested, enabling --snapshot" t=2022-02-07T06:11:47+0000 lvl=info msg="Set global gas cap" cap=25,000,000 t=2022-02-07T06:11:47+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:11:47+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144 t=2022-02-07T06:11:55+0000 lvl=info msg="Snap sync requested, enabling --snapshot" t=2022-02-07T06:11:55+0000 lvl=info msg="Set global gas cap" cap=25,000,000 t=2022-02-07T06:11:55+0000 lvl=info msg="Allocated trie memory caches" clean="2.20 GiB" dirty="3.66 GiB" t=2022-02-07T06:11:55+0000 lvl=info msg="Allocated cache and file handles" database=/home/disk/geth/mainnet/geth/chaindata cache="5.86 GiB" handles=262,144

serfiraz21 avatar Feb 07 '22 07:02 serfiraz21

@yo31400 @serfiraz21 Hi guys, please make sure you are running prune state or pruning block data, they are totally two different scenarios. For prune blocks, the complete command was like: ./geth snapshot prune-block --datadir ./node --datadir.ancient ./chaindata/ancient --block-amount-reserved [amount of blocks to reserve]

Mercybudda avatar Feb 08 '22 14:02 Mercybudda

@yo31400 @serfiraz21 Hi guys, please make sure you are running prune state or pruning block data, they are totally two different scenarios. For prune blocks, the complete command was like: ./geth snapshot prune-block --datadir ./node --datadir.ancient ./chaindata/ancient --block-amount-reserved [amount of blocks to reserve]

With this command same error: Failed to remove old ancient directory %v LOG15_ERROR= LOG15_ERROR="Normalized odd number of arguments by adding nil" remove C:\node\geth\chaindata\ancient\PRUNEFLOCK: The process cannot access the file because it is being used by another process.

And deleted all ancient blocks

Vladis432 avatar Feb 10 '22 00:02 Vladis432

@Vladis432 Have you stopped the geth process? And have you specified the amount for arg --block-amount-reserved?

Mercybudda avatar Feb 10 '22 02:02 Mercybudda

@Mercybudda of course. And before that - restarted the PC, to be sure. Is it working for you?

Vladis432 avatar Feb 10 '22 13:02 Vladis432

You can follow the guide here to fix this issue: https://github.com/binance-chain/bsc/releases/tag/v1.1.8

  1. Stop The node.
  2. Upgrade the binary to the latest release.
  3. Start the node with --snapshot=false
  4. Wait for a few minutes(it depends on how fast the node is), until the block height is 128 higher than where it stopped.
  5. Restart the node with --snapshot=true
  6. The node will continue to sync and repair the corrupt data.

Please proceed to join our Discord channel for more discussion at https://discord.com/invite/buildnbuild

RumeelHussainbnb avatar Feb 10 '22 14:02 RumeelHussainbnb