nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

Better way of monitoring pruning progress?

Open ibhagwan opened this issue 3 years ago • 2 comments

I read the entire documentation regarding pruning so hopefully I didn't miss anything.

As per my understanding when using Pruning.FullPruningTrigger=Manual (which is the default), the way to initiate pruning is by enabling the Admin module via JsonRpc.EnabledModules and then caling admin_prune:

curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"admin_prune","params":[],"id":1}' \
  localhost:8545

The above, did start my pruning process, after which subsuequnt calls to admin_prune return InProgress:

{
  "jsonrpc": "2.0",
  "result": "InProgress",
  "id": 1
}

That means that in order to check if the pruning is done I have to repeatedly call admin_prune (or check if there's more than one folder under nethermind_db\<network>\state?)

The issue I have with this approach is that the same API is used for both starting and monitoring the pruning, obviously there is Pruning.FullPruningMinimumDelayHours which defaults to 240 hours so once the pruning is done any subsequent call to admin_prune returns Delayed:

{
  "jsonrpc": "2.0",
  "result": "Delayed",
  "id": 1
}

My issues/questions:

  • I can't tell if the pruning succeeded or failed (for example, out of disk space) without shutting down the client by setting Pruning.FullPruningCompletionBehavior="ShutdownOnSuccess" which is undersireable for obvious reasons
  • I don't wish to run pruning again at the end of FullPruningMinimumDelayHours, I just want to check if pruning was finished and wether it was succsful or not
  • Following up on previous bullet: does Delayed mean pruning will automatically begin once the 240 hour timer set by FullPruningMinimumDelayHours ends? If so, that is also undesireable as I don't want to start pruning again automatically

ibhagwan avatar Sep 27 '22 21:09 ibhagwan

Also there is a memory leak somewhere in Pruning if it's triggered manually.

My Nethermind crashed by OOM with 92GB in VM when I've activated pruning.

gituser avatar Sep 28 '22 12:09 gituser

Also there is a memory leak somewhere in Pruning if it's triggered manually.

My Nethermind crashed by OOM with 92GB in VM when I've activated pruning.

@kkokosa

dceleda avatar Sep 28 '22 13:09 dceleda

We need an estimate of progress. Number of nodes processed would help, but percentage would be ideal. Secondly, when it fails, and indication of the error is really important.

Lenoftawa avatar Feb 02 '23 10:02 Lenoftawa

I hope new pruning docs explain something a bit https://docs.nethermind.io/fundamentals/pruning

But to address all topics from this pretty old issue:

  1. There were some memory issues on pruning but now it works well
  2. To check the pruning outcome you should follow logs - that is the only way for now.
  3. Delay means exactly what you referred - will be triggered after delay period will be fulfilled

About progress it is a moving target so hard to set a percentage which will be accurate, we have already quite a few issues around that but not yet having any good solution.

kamilchodola avatar Jun 03 '24 11:06 kamilchodola

Ty @kamilchodola!

ibhagwan avatar Jun 03 '24 12:06 ibhagwan