Continuous backlog population#3999
Merged
clemahieu merged 10 commits intonanocurrency:developfrom Jan 16, 2023
Merged
Conversation
Contributor
|
It looks like the unit test 'request_aggregator.cannot_vote' failed 4 times. |
Contributor
Author
|
@dsiganos I see, there seems to be two tests that are still failing, I'm looking into that. Appears to only break on GH runners, so a bit annoying to debug. |
Contributor
|
It fails when the system is under heavy load. Starting a parallel build from scratch seems to make it crash. I got this crash on my laptop: |
dsiganos
reviewed
Nov 18, 2022
Contributor
|
I left a number of minor comments but it looks good to me overall. |
64218b6 to
ce52a8f
Compare
dsiganos
reviewed
Dec 2, 2022
98227de to
3e60600
Compare
…xpects that it will not receive a vote for send1 because it has not made such a request, however, if the election is still or recently active, it may receive a broadcast vote before it makes a request. Check that the election has ended on node1 and allow some time for in-flight votes broadcasts to finish before starting node2.
3e60600 to
e848e09
Compare
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.
Backlog population is a process in which a node scans all accounts in the ledger, with or without any confirmed blocks, and forwards (activates) those accounts which do not have all their blocks confirmed to election scheduler for prioritization and eventual queuing in proper bucket. It is necessary to do this periodically, because the amount of space in each bucket is limited (currently ~2000 entries) and number of accounts needing confirmations can be much higher than that, especially during bootstrap or network spam attack.
The problem with current implementation is that this process runs every 5 minutes and scans the whole ledger at once, leading to situations where we run out of accounts to prioritize before the next run has started. This is especially visible during bootstrapping, a graph showing such situation is included below. We can clearly see the bumps in AEC occupancy where prioritization queue is filled, followed by periods of idleness when priority queue is emptied:
This PR fixes that by modifying the way the ledger scan is done. Instead of 5 minute interval, we run the scan all the time (unless disabled by setting
frontiers_confirmation = disablednode config setting), but we throttle the rate at which the scan is done to limit consumption of node resources. The rate and frequency is controlled by two new node-config.toml settings:backlog_scan_batch_sizeandbacklog_scan_frequency. By default it scans 10000 accounts per second divided into 10 batches, so 1000 accounts per batch. This is rather conservative and should be later adjusted with feedback from beta node operators (before this PR we dit it in batches of 64k).The result of this PR is the AEC that stays full almost all the time (except the initial phase of the bootstrap):