[BugFix] Fix num_short_key_columns mismatch in partial tablet schema#70586
Conversation
When creating a partial tablet schema for column-mode partial update on a table with separate sort keys (ORDER BY), num_short_key_columns is copied from the source schema but sort_key_idxes may be empty if the sort key columns are not in the partial schema. _init_from_pb then falls back sort_key_idxes to key columns, creating a mismatch where num_short_key_columns > sort_key_idxes.size(). This causes a DCHECK crash in SeekTuple::short_key_encode during segment writing in ASAN builds. Fix by ensuring num_short_key_columns <= sort_key_idxes.size() after constructing the partial schema. Fixes StarRocks/StarRocksTest#11136 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: luohaha <18810541851@163.com>
5c4952f to
901757e
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 4 / 4 (100.00%) file detail
|
|
@Mergifyio backport branch-4.0 |
|
@Mergifyio backport branch-3.5 |
✅ Backports have been createdDetails
Cherry-pick of ea8b566 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
✅ Backports have been createdDetails
Cherry-pick of ea8b566 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
PrimaryKeyEncodingType does not exist on branch-4.0. Keep only the short key consistency test from #70586. Signed-off-by: luohaha <18810541851@163.com>
…tarRocks#70586) Signed-off-by: luohaha <18810541851@163.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
https://github.com/Mergifyio backport branch-4.1 |
|
https://github.com/Mergifyio backport branch-4.1.0 |
✅ Backports have been createdDetails
|
✅ Backports have been createdDetails
|
…tarRocks#70586) Signed-off-by: luohaha <18810541851@163.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…70586) Signed-off-by: luohaha <18810541851@163.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Why I'm doing:
Fix BE DCHECK crash
num_short_keys <= sort_key_idxes.size()inSeekTuple::short_key_encodeduring column-mode partial update on primary key tables with separate sort keys (e.g.ORDER BY(k3, k2)).TabletSchema::createcopiesnum_short_key_columnsfrom the source schema (e.g. 2), butsort_key_idxesin the partial schema may be empty when sort key columns are not in the partial column set._init_from_pbthen falls back to using key columns as sort keys (e.g. size=1), creating an inconsistency:num_short_key_columns(2) > sort_key_idxes.size()(1).What I'm doing:
After constructing the partial tablet schema, ensure
num_short_key_columns <= sort_key_idxes.size()to keep them consistent.Trigger SQL:
Fixes https://github.com/StarRocks/StarRocksTest/issues/11136
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: