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.
Issue Addressed
N/A
Proposed Changes
Hopefully fixes all backfill stalled issues we have been seeing.
The root cause of the issue is that the
peer_disconnect
function returns early if the call toretry_batch_download
within it returns an error. This can happen when we have no synced peers to retry from.This early return fails to set the
BatchState
for multiple batches fromBatchState::Downloading
toBatchState::AwaitingDownload
If the
processing_target
batch was also one of the batches that failed to change states, then backfill effectively stalls.When we resume backfill after getting new peers, we do the following which could potentially re-request the target:
resume_batches
lighthouse/beacon_node/network/src/sync/backfill_sync/mod.rs
Lines 1002 to 1016 in c7e5dd1
Since the
processing_target
is stuck inBatchState::Downloading
, it is not requested in this callrequest_batches
which does nothing because of this condition:lighthouse/beacon_node/network/src/sync/backfill_sync/mod.rs
Lines 1083 to 1091 in c7e5dd1
In most of the logs that I have seen of this issue,
batches.len()
is usually >BACKFILL_BATCH_BUFFER_SIZE
Hence, the target can never be requested again and the target state can never change until a restart.
This PR basically handles the error in
peer_disconnect
instead of short circuiting.