[BugFix] FSE-v2 missed setting the schema for shared-data sorted schema change (backport #72235)#72377
Merged
xiangguangyxg merged 1 commit intoApr 30, 2026
Conversation
…ma change (backport StarRocks#72235) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: wanpengfei-git <wanpengfei91@163.com> (cherry picked from commit d70921f) Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
24 tasks
xiangguangyxg
approved these changes
Apr 30, 2026
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.
Why I'm doing:
On shared-data, an ALTER that changes the sort key is wrongly cancelled
with a misleading "table not found" when the schema cache is disabled:
Walking the cause:
This alter runs through
SortedSchemaChange, which writes the convertedrowsets through
DeltaWriter. The builder is only fedschema_id; thewriter is left to resolve the schema itself.
Since [Enhancement] Add BE TableSchemaService for Fast Schema Evolution in shared-data #66699 (FSE-v2 in shared-data, merged Dec 2025),
DeltaWriterresolves the schema through
TableSchemaService, whose lookup chain is:Shared-data alter tasks (
TAlterTabletReqV2) don't carry catalog ids.When the lookup falls through to the RPC, the request goes out with
db_id=0, table_id=0and FE rightly answers "Table not exist".The bug has been latent because the cache (default 2 GB) and cached
tablet metadata almost always answer the schema lookup before the RPC.
Disabling the cache exposes the broken RPC path.
DirectSchemaChangeis unaffected — it builds its writer with aTabletSchemaPtrdirectly and never touches the service.What I'm doing:
The sorted schema change already holds the new tablet schema; the
schema-service lookup is unnecessary. Hand the schema to
DeltaWriterdirectly.
DeltaWriterBuildergainsset_tablet_schema(TabletSchemaPtr). Whenset,
DeltaWriter::init_tablet_schema()short-circuits and bypassesTableSchemaServiceentirely.set_schema_idis still required andvalidated against the preset schema's id.
SortedSchemaChange::processpasses the new tablet schema into thebuilder.
DirectSchemaChangeis unchanged.As a side effect this also removes one (normally successful) RPC per
sorted schema change in the cache-hit case — the residual TODO already
flagged in
schema_change.cpp.What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
schema RPC sync point, and asserts the sorted schema change runs
end-to-end without firing the RPC.
test_fse_alter_with_metacache_off @cloudpinning the originalrepro.
Bugfix cherry-pick branch check: