New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catchup: pause catchup if ledger lagging behind #5794
catchup: pause catchup if ledger lagging behind #5794
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5794 +/- ##
=======================================
Coverage 55.55% 55.55%
=======================================
Files 474 474
Lines 66850 66877 +27
=======================================
+ Hits 37138 37153 +15
- Misses 27188 27199 +11
- Partials 2524 2525 +1
... and 11 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks for the review, pushed fixes |
78830a8
to
63ef58f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand better now, this doesn't strictly stop catchup from downloading more blocks than the max: it only stops catchup if the max deltas is exceeded AND the commitSyncer is running inside the transaction context used to call trackers' commitRound() functions. So as a side effect of DB flushing taking a while, once you exceed the max, you have a high chance of an IsBehind call noticing and catchup being stopped, and maybe another block or two could sneak in past the max. But the net effect is this PR will force catchup to wait for a slow DB flush operation to finish before continuing.
e85936b
Added pausing |
Summary
It is possible catchup downloads blocks faster than ledger commits it slow disks. This could cause OOM because of too many pending deltas.
Implementation overview
Ledger.Available()
method.MaxAcctLookback
is manually set greater than 256, useMaxAcctLookback+1
as a new max.Additionally moved
trackerRegistry.dbRound
initialization frominitialize
toloadFromDisk
to 1) simplify testing 2) it seems naturally belongs toloadFromDisk
.Considered improvement(s) [not implemented]
Test Plan
Added unit tests to catchup and ledger packages.
Run a manual mainnet catchup test.
.details.NewBase - .details.OldBase