Skip to content

Conversation

@patrickbrophy
Copy link
Contributor

Fixes #2827. When running pelican object stat --checksums sha, the client would display what checksum the server returned without any indication that the requested checksum type wasn't provided. Now we track the requested checksums and track that they are satisfied. We now log a warning when the requested checksum types are not returned by the server.

@patrickbrophy patrickbrophy added this to the v7.23 milestone Dec 8, 2025
Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some clarifying questions, just so I understand the fix.

delete(remaining, info.Algorithm)
collected = true
}
if len(remaining) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify more my own understanding, since you only delete info.Algorithm from remaining when there is no checksumErr, this is only true if all the checksums have evaluated with no error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. The delete(remaining, info.Algorithm) happens whenever fetchChecksum successfully returns checksums from any URL in statUrls. So len(remaining) == 0 indicates "all requested checksums were successfully collected from at least one server each" - not necessarily that there were zero errors. You could have errors on some URLs but still succeed if another URL provides all the checksums.

if checksumErr == nil {
checksumErr = errors.New("no checksum data returned by server")
}
err = errors.Wrap(checksumErr, "failed to fetch checksums")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this mean if the server doesn't have checksumming, this will throw an error? Or is there a check higher up in the algorithm I can't see due to the nature of the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but only if the caller explicitly requested checksums. This is intentional behavior, if a caller explicitly requests checksums and the server can't provide them, that's a failure condition. If no checksums are requested, this code path is skipped entirely and everything proceeds normally.

Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@patrickbrophy patrickbrophy merged commit fe44f9d into PelicanPlatform:main Jan 20, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pelican stat obj --checksums sha returns MD5

2 participants