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

[C++][FS][Azure] Edgecase where GetFileInfo incorrectly returns NotFound on flat namespace and Azurite #44256

Closed
Tom-Newton opened this issue Sep 30, 2024 · 2 comments
Assignees
Milestone

Comments

@Tom-Newton
Copy link
Contributor

Tom-Newton commented Sep 30, 2024

Describe the bug, including details regarding any error messages, version, and platform.

The problem
Imagine in the following directory structure:

container-name/a/    directory
container-name/a.txt    file 

fs->GetFileInfo("container-name/a/") returns FileType::NotFound.

Why it happens

  1. fs->GetFileInfo("container-name/a/") returns causes a list with prefix a and limit 1.
  2. The result is a.txt because . comes before / lexographically.
  3. This doesn't match the requested name so return FileType::NotFound.

Component(s)

C++

@Tom-Newton
Copy link
Contributor Author

I'm going to try fixing this. I think it will require an extra list operation but only in this edgecase.

kou pushed a commit that referenced this issue Oct 4, 2024
… returns NotFound on flat namespace and Azurite (#44302)

### Rationale for this change
Fix a bug where `GetFileInfo` incorrectly returns `FileType::NotFound` on flat namespace and Azurite.

### What changes are included in this PR?
Fix by detecting the exact edgecase and doing an extra listing operation to disambiguate. 

### Are these changes tested?
Yes, updated automated test

### Are there any user-facing changes?
Only a bug fix.

* GitHub Issue: #44256

Authored-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 18.0.0 milestone Oct 4, 2024
@kou
Copy link
Member

kou commented Oct 4, 2024

Issue resolved by pull request 44302
#44302

@kou kou closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants