restore: http head resolve (full and incr)#9050
Open
jvarela-jump wants to merge 1 commit intomainfrom
Open
Conversation
Performance Measurements ⏳
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves robustness of incremental snapshot downloading in snapct by validating a peer’s actually-served incremental snapshot (via an HTTP HEAD) before attempting the GET, avoiding failures caused by stale gossip advertisements.
Changes:
- Add
fd_sshead, a non-blocking lifecycle wrapper aroundfd_ssresolvefor plain-HTTPHEADpre-resolves, plus a comprehensive unit test. - Update
fd_ssresolverequest rendering and response handling (Host header includes port; improved redirect/zstd validation; better handling of full response buffers and disconnects). - Integrate incremental snapshot
HEADpre-resolve intofd_snapct_tileto confirm/adjustincr_slot(skip for configured HTTPS peers where periodic HEAD resolves already occur).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/discof/restore/utils/test_sshead.c | New unit test coverage for fd_sshead behaviors (success, redirects, malformed responses, timeout, disconnect, buffer-full, etc.). |
| src/discof/restore/utils/fd_ssresolve.c | Improves HTTP request Host header, redirect parsing diagnostics, and response read edge-case handling. |
| src/discof/restore/utils/fd_sshttp_private.h | Increases internal sshttp deadline constant to 2 seconds. |
| src/discof/restore/utils/fd_sshead.h | New public API for fd_sshead (start/advance/cancel/active + shmem lifecycle). |
| src/discof/restore/utils/fd_sshead.c | Implements non-blocking HEAD pre-resolve wrapper around fd_ssresolve using poll/connect/timeout/cleanup. |
| src/discof/restore/fd_snapct_tile.c | Adds incremental pre-resolve state handling to verify served incr_slot before download and avoid blacklisting due to stale gossip. |
| src/discof/restore/Local.mk | Wires fd_sshead into the build and adds/runs the new test_sshead unit test. |
2909dde to
e2ee7f1
Compare
Performance Measurements ⏳
|
e2ee7f1 to
7c61ac4
Compare
7c61ac4 to
87488ef
Compare
Performance Measurements ⏳
|
87488ef to
aad8719
Compare
Performance Measurements ⏳
|
d288db7 to
e52959c
Compare
Performance Measurements ⏳
|
e52959c to
0f52524
Compare
Performance Measurements ⏳
|
ca3104a to
7f39e18
Compare
Performance Measurements ⏳
|
7f39e18 to
21ab4ae
Compare
Performance Measurements ⏳
|
21ab4ae to
d005cdd
Compare
Performance Measurements ⏳
|
d005cdd to
ea91c78
Compare
Performance Measurements ⏳
|
ea91c78 to
832f870
Compare
Performance Measurements ⏳
|
832f870 to
b05f09f
Compare
Performance Measurements ⏳
|
b05f09f to
38dfa96
Compare
Performance Measurements ⏳
|
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.
There are two parts in this PR:
httppeers): by the time an incremental snapshot for the givenfull_slotand advertisedincr_slotis requested, the incremental snapshot may not be available (and the snapshot load pipeline blacklists the peer). To make thehttp getmore robust against gossip, this PR introducesfd_sshead. Then thesnapcttile performs anhttp headagainst the best peer, validates theincr_slotthat is being actually served, and (if valid) adjusts the incremental snapshot name before proceeding with the download request.As an example of the observed behavior:
Closes #8956.
http headresolve to the full snapshot (to filter gossip peers that advertise an RPC address but does not respond to http requests.Closes #9091.