ledgerwatch / erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
3.03k stars 1.04k forks source link

Too much reclaimable data in DB #10744

Closed ImTei closed 58 minutes ago

ImTei commented 1 week ago

Hi, I'm Tei from Sunnyside Labs(Test in Prod) who is building op-erigon. One of our users recently reported a non-uniform DB size growth when they were using op-erigon. The size of the DB is multiple of a normal DB of the same chain. We have investigated this case with them and found the following things:

The Used pages are equal to the normal DB. So the abnormal DB growth is because of its reclaimable data, but it seems GC is not working as expected. I read some similar issues and MDBX docs so I understand that this is caused by some long-running DB txs -- maybe due to debug trace RPCs, but not sure the root cause.

As some guides from similar issues, it seems we can reclaim those data by copying MDBX, but it couldn't be the solution for the long-running nodes on production.

So I wonder if there's any solution or ongoing improvement about this issue. Please let me know if I'm missing something. Thank you!

AskAlexSharov commented 1 week ago

You need somehow limit - how long debug_traceCall allowed to work. Thats it. Just don’t open read transaction for unlimited amount of time.

ImTei commented 1 week ago

@AskAlexSharov Thank you. I have 2 questions.

awskii commented 58 minutes ago

Hey @ImTei