8000 [BugFix] LakeRollup should use physical partition ID instead of partition ID. by sevev · Pull Request #60073 · StarRocks/starrocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BugFix] LakeRollup should use physical partition ID instead of partition ID. #60073

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sevev
Copy link
Contributor
@sevev sevev commented Jun 19, 2025

Why I'm doing:

In shared-data mode, the allocation of shardGroup and shard should correspond to the physical partition ID, rather than the partition ID.

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.5
    • 3.4
    • 3.3

Signed-off-by: sevev <qiangzh95@gmail.com>
@sevev sevev requested a review from a team as a code owner June 19, 2025 08:12
@mergify mergify bot assigned sevev Jun 19, 2025
Copy link
Contributor
@wyb wyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some UT?

Sorry, something went wrong.

@sevev
Copy link
Contributor Author
sevev commented Jun 19, 2025

Add some UT?

I will add some test case.

Signed-off-by: sevev <qiangzh95@gmail.com>
Copy link

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 5 / 5 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/alter/LakeTableRollupBuilder.java 3 3 100.00% []
🔵 com/starrocks/server/LocalMetastore.java 2 2 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@sevev sevev requested a review from wyb June 20, 2025 01:45
@@ -98,8 +98,8 @@ public AlterJobV2 build() throws StarRocksException {
.collect(Collectors.toList());
List<Long> shadowTabletIds = GlobalStateMgr.getCurrentState().getStarOSAgent().createShards(
originTablets.size(),
olapTable.getPartitionFilePathInfo(p 8000 artitionId),
olapTable.getPartitionFileCacheInfo(partitionId),
olapTable.getPartitionFilePathInfo(physicalPartitionId),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may cause the new shadowTablets storage path differs from the original ones, consider before/after upgrading, will there be compatible issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shadowTablets storage path differs from the original

Upgrading may indeed cause path switching, but the logic will not be problematic. This is because during actual operation, it relies on the shard information returned by starmgr to locate the tablet and the change will only affect the save path when creating the tablet.

@@ -74,7 +74,7 @@ public AlterJobV2 build() throws StarRocksException {
long physicalPartitionId = physicalPartition.getId();
// create shard group
long shardGroupId = GlobalStateMgr.getCurrentState().getStarOSAgent().
createShardGroup(dbId, olapTable.getId(), partitionId, rollupIndexId);
createShardGroup(dbId, olapTable.getId(), physicalPartitionId, rollupIndexId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also with this change, we need to keep in mind that in future if anyone want to use the "partitionId" attached to the shardGroup property, it can be partitionId or physicalPartitionId based on when the shardGroup is created. May need to record this info somewhere.

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.

4 participants
0