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

[BugFix][Cherry-pick][Branch-2.5] Be maybe crash when we do schema change for primary key table with separate primary key and sort key (backport #20035) #36636

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

sevev
Copy link
Contributor

@sevev sevev commented Dec 7, 2023

If we create a primary key table with a separate primary key and sort key, BE maybe crash if we do a schema change in the table(add column/drop column) The reason is that we use column id as the sort key index in the tablet, and we only support reordering the sort key in this pr(#13642) which assumes the number of columns in the origin tablet and new tablet during schema change is the same. However, if we add/drop a column, the sort key index in the new tablet will be different from the origin tablet and we will execute reorder which may cause BE crash.

…e with separate primary key and sort key (StarRocks#20035)

If we create a primary key table with a separate primary key and sort key, BE maybe crash if we do a schema change in the table(add column/drop column)
The reason is that we use column id as the sort key index in the tablet, and we only support reordering the sort key in this pr(StarRocks#13642) which assumes the number of columns in the origin tablet and new tablet during schema change is the same. However, if we add/drop a column, the sort key index in the new tablet will be different from the origin tablet and we will execute reorder which may cause BE crash.

Signed-off-by: zhangqiang <[email protected]>
Signed-off-by: zhangqiang <[email protected]>
Copy link

sonarcloud bot commented Dec 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link

github-actions bot commented Dec 8, 2023

[FE Incremental Coverage Report]

fail : 1 / 2 (50.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/alter/SchemaChangeJobV2.java 1 2 50.00% [318]

Copy link

github-actions bot commented Dec 8, 2023

[BE Incremental Coverage Report]

fail : 9 / 15 (60.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/storage/tablet_updates.cpp 4 8 50.00% [3196, 3197, 3198, 3199]
🔵 src/storage/schema_change.cpp 5 7 71.43% [774, 775]

@wanpengfei-git wanpengfei-git merged commit 7f7434e into StarRocks:branch-2.5 Dec 8, 2023
21 of 23 checks passed
@sevev sevev changed the title [BugFix][Cherry-pick][Branch-2.5] Be maybe crash when we do schema change for primary key table with separate primary key and sort key (#20035) [BugFix][Cherry-pick][Branch-2.5] Be maybe crash when we do schema change for primary key table with separate primary key and sort key (backport #20035) Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants