[Enhancement] Support sparse segment idx in shared-data storage metadata#68996
Merged
xiangguangyxg merged 1 commit intoStarRocks:mainfrom Feb 13, 2026
Merged
[Enhancement] Support sparse segment idx in shared-data storage metadata#68996xiangguangyxg merged 1 commit intoStarRocks:mainfrom
xiangguangyxg merged 1 commit intoStarRocks:mainfrom
Conversation
|
@codex review |
0a84a06 to
3066298
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a84a0610c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
3066298 to
d7103df
Compare
srlch
previously approved these changes
Feb 9, 2026
d7103df to
a296243
Compare
srlch
previously approved these changes
Feb 12, 2026
wyb
reviewed
Feb 12, 2026
Signed-off-by: xiangguangyxg <xiangguangyxg@gmail.com>
a296243 to
91bf45c
Compare
Contributor
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Contributor
[BE Incremental Coverage Report]✅ pass : 162 / 171 (94.74%) file detail
|
|
wyb
approved these changes
Feb 13, 2026
srlch
approved these changes
Feb 13, 2026
Contributor
|
@Mergifyio backport branch-4.1 |
Contributor
✅ Backports have been createdDetails
|
Merged
24 tasks
HangyuanLiu
pushed a commit
to HangyuanLiu/starrocks
that referenced
this pull request
Feb 13, 2026
…ata (StarRocks#68996) Signed-off-by: xiangguangyxg <xiangguangyxg@gmail.com>
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:
Previously, the rssid (rowset-segment-id) was always computed as
rowset_id + segment_index, which implicitly assumed segment IDs arecontiguous (0, 1, 2, ...). This assumption prevents future optimizations
such as segment-level partial compaction or segment reuse across rowsets,
where segment IDs within a rowset may become sparse or non-contiguous.
What I'm doing:
Add an explicit
segment_idxfield toSegmentMetadataPBin the protobufdefinition, and update all lake storage code paths to use it instead of
deriving segment ID from the positional index.
Key changes:
optional uint32 segment_idx = 4toSegmentMetadataPBwithbackward-compatible fallback to segment index when the field is absent.
get_segment_idx,get_max_segment_idx,get_rowset_id_step,get_rssid) inmeta_file.h/cppto centralizesegment ID and rssid computation.
index loading, compaction publish, delta writer, schema change, spark
load, tablet reshard, and meta reader.
next_rowset_idadvancement fromstd::max(1, segments_size())to
get_rowset_id_step()which accounts for sparse segment IDs.txn_log_applierandmeta_fileto remapsegment IDs into the merged rowset's local ID space.
apply_opcompactionwithset-based lookup using
unordered_setfor correctness with sparse IDs.std::iotain compaction conflict checker with explicitget_rssidloop.Fixes #64986
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: