[core] Resolve compacted changelog real path next to the fake entry - #10236
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
decodePath rebuilt the real file path from the fake path's grandparent plus bucket-N. With external paths, including entropy-injected ones, the changelog compact task records the fake entry in the real file's directory, so the grandparent is a hash or external directory and the rebuilt real path pointed nowhere, breaking reads of compacted changelogs. When the fake path's parent is not a bucket directory, resolve the real file as a sibling in the same directory; the bucket-directory case keeps the cross-bucket rebuild. Assisted-by: GLM-5.3
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.
Purpose
CompactedChangelogPathResolver.decodePathrebuilt the real changelog path from the fake path's grandparent plusbucket-<bid>. That layout only holds for in-table storage, where the fake entry is placed in its own bucket directory while the real file lives in the bucket encoded in the fake name. With external paths, including entropy-injected ones,ChangelogCompactTaskrecords the fake entry in the real file's own directory, so the grandparent is a hash or external directory and the rebuilt path pointed at a location that does not exist, breaking reads of compacted changelogs.When the fake path's parent is a bucket directory,
decodePathkeeps the cross-bucket rebuild. Otherwise it resolves the real file as a sibling in the same directory. In the external case where the parent is still a bucket directory, both branches produce the same path, so in-table resolution is unchanged.This closes #10235.
Tests
Added
CompactedChangelogPathResolverTest.testResolveFakeWithExternalPath, which pins resolution for an entropy-injected external path to the sibling real file. It fails on the old grandparent-based rebuild. Existing in-table resolution cases stay green.API and Format
No.
Documentation
No.