fix(dir): use Prefix instead of StartAfter for directory existence check#168
Open
alexsavio wants to merge 1 commit intoyandex-cloud:masterfrom
Open
fix(dir): use Prefix instead of StartAfter for directory existence check#168alexsavio wants to merge 1 commit intoyandex-cloud:masterfrom
alexsavio wants to merge 1 commit intoyandex-cloud:masterfrom
Conversation
d161877 to
6fd8fe8
Compare
Replace StartAfter with invalid UTF-8 sequences (\xEF\xBF\xBD) with a direct Prefix-based query when checking for directory existence in intelligentListCut. The previous approach used StartAfter with '.\xEF\xBF\xBD' suffix to simulate a '>=' operator, but this relies on specific UTF-8 byte ordering behavior that may not work correctly with all S3-compatible storage backends. The new approach uses Prefix directly to query for items starting with 'path/' which is: - More straightforward and easier to understand - More portable across different S3-compatible backends - Avoids potential issues with UTF-8 handling in various implementations Also adds a default CLOUD=s3 in tests for easier local test execution.
6fd8fe8 to
e66fd01
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.
Pull Request: Use Prefix instead of StartAfter for directory existence check
Summary
This PR replaces the
StartAfterparameter with invalid UTF-8 sequences with a simplerPrefix-based query when checking for directory existence inintelligentListCut.Problem
The current implementation in
core/dir.gousesStartAfterwith a crafted UTF-8 suffix (.\xEF\xBF\xBD) to simulate a>=operator for directory existence checks:This approach:
We encountered issues with this approach when using AWS S3 in our setup.
Solution
Replace the
StartAfterapproach with a directPrefixquery:This is:
path/Changes
StartAfterwithPrefixinintelligentListCutCLOUD=s3for easier local test executionTesting
Related
This is similar in spirit to commit
de62549which removedStartAfter-based ext-v1 autodetection because it didn't work with Yandex S3.How to apply these changes
If you want to create this PR from your own fork: