Add third-party-copy (HTTP COPY) mode for the client#3141
Open
Add third-party-copy (HTTP COPY) mode for the client#3141
Conversation
Copilot
AI
changed the title
[WIP] Implement pelican object copy and sync functionality
Add third-party-copy (HTTP COPY) mode for the client
Feb 18, 2026
This was referenced Feb 19, 2026
Contributor
|
@bbockelm The error message when attempting a third-party copy between origins that aren't configured for it looks a bit odd: Specifically: "TPC request was not successful (status code 200): OK" |
Implement transferTypeCopy, NewCopyJob, copyHTTP, monitorTPC, and update DoCopy/object_copy/object_sync to handle remote-to-remote transfers using the HTTP COPY verb per WLCG TPC specification. Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
…ation tests Unit tests verify: - Performance marker parsing (monitorTPC) - Mock HTTP server implementing the COPY verb with performance markers - Error handling for failed TPC requests and failure markers Integration tests (require XRootD): - TestTPCPublicRead: TPC with public namespace (source is public) - TestTPCAuth: TPC with authenticated namespace Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
…ering - Initialize srcToken with source PelicanURL instead of destination URL - Add HTTP status code check for HEAD request to source in copyHTTP - Buffer the serverMessages channel to prevent potential deadlock Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
Now includes recursive copies and enable TPC in the origin.
- Add Client.CredentialFile parameter to docs/parameters.yaml - Regenerate param files with new Client_CredentialFile parameter - Add Client_CredentialFile override in GetEncryptedConfigName() - Add SaveConfigContentsToFile() for saving credentials to specific paths - Add HasEncryptedPassword() to check if credential file is password-protected - Create credentials_token_setup.go with the setup subcommand - Add --no-password, --credential-file, --read, --write flags - Add tests for new functionality Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
Improve error message when the origin lacks COPY verb support
e1c88c6 to
03d28c0
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.
Implements origin-to-origin transfers using the HTTP COPY verb per the WLCG HTTP-TPC specification. The client instructs the destination server to pull data directly from the source, rather than proxying bytes through itself.
Based on the approach drafted in #1604, adapted to the current codebase.
Core transfer engine (
client/handle_http.go)transferTypeCopytransfer type withsrcURL,srcToken,srcDirRespfields ontransferFileandTransferJobNewCopyJob()— creates a TPC job with separate director lookups and token acquisition for source and destinationcopyHTTP()— HEAD to source for size, then COPY to destination withSourceandTransferHeaderAuthorizationheadersmonitorTPC()— parses WLCG performance markers (Perf Marker / End blocks with stripe aggregation)WithSourceToken()/WithSourceTokenLocation()— transfer options for separate source authClient API (
client/main.go)DoCopy()now detects both-remote URLs viaisPelicanScheme()and routes todoThirdPartyCopy()DoGet/DoPutCLI (
cmd/object_sync.go)pelican object syncnow accepts both source and destination as federation URLs, using TPCUsage
Tests
TestMonitorTPC— perf marker parsing (multi-stripe, failure, empty body).TestTPCMockServer— mock HTTP server implementing COPY with performance markers and error scenarios.TestTPCPublicRead(public namespace, no source token) andTestTPCAuth(authenticated, both tokens) using federation test infrastructure.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cilogon.org/tmp/go-build3572016247/b001/client.test /tmp/go-build3572016247/b001/client.test -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.run=TestCopyAuth -test.count=1 .cfg 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/vet -p AD/microsoft-aut--norc mpile 0.1-go1.25.0.linux-amd64/pkg/too-buildtags -o om/munnerz/goautoneg@v0.0.0-2019-errorsas .cfg 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/vet -p ongo-driver/bson--64 m 0.1-go1.25.0.lin/tmp/ccVamdr5.o(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.