-
Notifications
You must be signed in to change notification settings - Fork 724
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
Fix backfill stalling #5192
Merged
Merged
Fix backfill stalling #5192
Conversation
This file contains 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
pawanjay176
force-pushed
the
fix-backfill
branch
from
February 5, 2024 20:25
0e3175c
to
80b4b08
Compare
AgeManning
approved these changes
Feb 8, 2024
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.
Yeah nice find.
I also notice that in the case that we short-circuit we also don't remove the peer from the participating_peers()
mapping, which also looks like it could have dormant issues.
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 0b59d10 |
AgeManning
added
ready-for-merge
This PR is ready to merge.
v5.0.0
Q1 2024
and removed
ready-for-review
The code is ready for review
labels
Feb 8, 2024
This was referenced Feb 8, 2024
danielramirezch
pushed a commit
to danielramirezch/lighthouse
that referenced
this pull request
Feb 14, 2024
* Prevent early short circuit in `peer_disconnected` * lint
Closed
This pull request was closed.
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.
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.