Skip to content

[core] Resolve compacted changelog real path next to the fake entry - #10236

Open
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-060-changelog-decode
Open

LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:m/core-060-changelog-decode

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Purpose

CompactedChangelogPathResolver.decodePath rebuilt the real changelog path from the fake path's grandparent plus bucket-<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, ChangelogCompactTask records 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, decodePath keeps 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.

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
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.

[Bug] Reading compacted changelog fails when external paths use entropy injection

1 participant