-
Notifications
You must be signed in to change notification settings - Fork 548
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 output when stat a prefix which has other prefixes #4501
Merged
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
`λ mc stat --debug play/testbucket2/dir1/` output
|
mc stat <alias>/<bucket>/<dir>/ can show bucket meta-information when <dir>/ contains a prefix as well. Bucket stat info is called inside the listing loop code, which is wrong and causes bad performance issue which some prefixes are found during stat command.
@klauspost I am not able to reproduce the issue. It looks like it is a Windows thing. I rebased the PR with master, can you try again ? |
@vadmeste Great success!
|
klauspost
approved these changes
Mar 22, 2023
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.
LGTM - Tested on Windows.
harshavardhana
approved these changes
Mar 23, 2023
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.
Description
mc stat <alias>/<bucket>/<dir>/
can show bucket meta-informationwhen
<dir>/
contains a prefix as well.Bucket stat info is called inside the listing loop code, which is wrong
and causes bad performance issue which some prefixes are found
during stat command.
Motivation and Context
Fix stat output in some cases
How to test this PR?
mc mb play/testbucket/
mc cp file play/testbucket/dir1/
mc cp file play/testbucket/dir1/dir2/
mc stat play/testbucket/dir1/
Types of changes
Checklist:
commit-id
orPR #
here)