Skip to content
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

Stat fix #65

Merged
merged 4 commits into from
Dec 14, 2024
Merged

Stat fix #65

merged 4 commits into from
Dec 14, 2024

Conversation

rw2
Copy link
Collaborator

@rw2 rw2 commented Dec 13, 2024

Detects prefix collisions on directories and handles them correctly

@rw2 rw2 linked an issue Dec 13, 2024 that may be closed by this pull request
rw2 and others added 3 commits December 14, 2024 08:05
It appears the getSize method for the HEAD request was never
correctly implemented.  Move the HEAD header response parsing
into the class and refactor `Fstat` to use it.
The prior fix for handling of empty object names (such as when you
are listing the root of the bucket) depended on counting `/` characters
(which may be inconsistent if the paths aren't normalized) and didn't
cover the `S3FileSystem::Create` and `S3File::Open` methods.

This pushes the fix into the `parsePath` method and adds unit test
coverage to watch for regressions.
This tweaks the `Stat` logic so, if the object exists, we only query
it one time.  We still fallback to listing objects in case of a
pseudo-directory.

Includes unit test coverage.

Fixes PelicanPlatform#63
Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

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

First version still had two round trips if the object existed. Refactored it to only do the second round trip if it's a pseudo-directory.

This also required reworking the AmazonS3Head implementation as its getSize method didn't actually function, also allowing a simplification for Fstat.

@bbockelm bbockelm merged commit ab22c54 into PelicanPlatform:main Dec 14, 2024
3 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.

Stat fails on a sub-directory when there's an object with the same prefix.
2 participants