Repository navigation
Conversation
ndr-ds
force-pushed
the
ndr-ds/pace-received-log-downloads
branch
from
September 18, 2026 01:39
d274660 to
d6b9176
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #6631 — same change, rebased onto current
main(the original branched 2026-07-28 and was 81 commits behind), plus the threshold turned into a flag.Motivation
Client::get_received_log_from_validatorpages a validator'sreceived_login 20 000-entry pages with no pacing at all. On the validator side each page becomesreceived_log.read(start..end), which reads one storage row per entry — so a long backlog walk saturates the validator's storage and degrades read latency for every other client of that validator.Measured on
testnet_conway: statement-class IOPS go from ~100/s to ~5 500/s and read p99 from 6 ms to 4.3 s, for 20–60 minutes, which then stalls chains across the whole PM fleet.Pacing existed in the original design (#4706, as
sync_sleep_ms) and was removed wholesale by #4708.Proposal
After the first few full pages — by then it is clearly a backlog walk, not a routine sync — sleep between pages for as long as the previous page took to serve.
That is self-tuning in a useful direction: it caps the walk at roughly half the validator's serving capacity for this client, and automatically backs off further when the validator is already slow. Short syncs never reach the threshold and are unaffected.
Beyond the original PR
The original hardcoded
RECEIVED_LOG_PAGES_BEFORE_PACING = 5. It is now--received-log-pages-before-pacing, defaulting to the same 5 viaDEFAULT_RECEIVED_LOG_PAGES_BEFORE_PACING, threaded throughClientOptions→chain_client::Optionslike the other sync tunables (--sender-certificate-download-batch-size,--max-concurrent-batch-downloads).0paces from the first page.The right value depends on backlog size and validator capacity, neither of which is known at compile time — and if a storm is in progress, being able to lower it without a release is the point.
Test Plan
cargo check -p linera-clientpasses (the flag threads throughlinera-coreandlinera-client).CLI.mdregenerated withcargo run --bin linera -- help-markdown, socheck-outdated-cli-mdstays green.Honest limits. There is no automated test: asserting "it slept between pages" needs a fake clock plus a validator stub that serves ≥ 6 full 20 000-entry pages, which the current test harness does not provide. The change is also a mitigation, not a fix, and the arithmetic should be read before merging:
Whether that trade is worth it depends on whether the pain is peak latency (it helps) or total storm duration (it does not). It composes well with #6830, which keeps backlogs small enough that pacing rarely triggers at all.
Release Plan
testnetbranch, thenLinks
info; Order LogView index keys so a range of entries is contiguous in storage #6829 makes each entry of any walk cheap by ordering LogView keys.