-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Issue Number: #55756 #59350
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
sgy861
wants to merge
3
commits into
apache:master
Choose a base branch
from
sgy861:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Issue Number: #55756 #59350
Conversation
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
…kend-mapping Show cloud colocate group bucket->backend mapping in proc
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Author
|
What problem was fixed
This PR fixes SHOW PROC '/colocation_group/{dbId}.{groupId}' in Cloud mode.
Previously, ColocationGroupProcDir.lookup();always called ColocateTableIndex.getBackendsPerBucketSeq(groupId) to build backend sequences. In Cloud mode, this backend-sequence lookup is not applicable and could fail or return unusable results for the proc output.
How it was fixed
The fix adds Cloud-mode-aware logic to ColocationGroupProcDir.lookup():
Non-cloud mode: Preserve the existing behavior by calling getBackendsPerBucketSeq(groupId) and returning ColocationGroupBackendSeqsProcNode based on the computed backend sequences.
Cloud mode:
Validate the group exists by retrieving ColocateGroupSchema and throwing an AnalysisException if the group is missing.
Validate the group contains at least one table (used to construct a representative CloudReplica) and throw an AnalysisException if empty.
Construct per-bucket backend sequences by creating a CloudReplica for each bucket and calling replica.getBackendId() to resolve the backend mapping. Any ComputeGroupException ;is converted to an AnalysisException.
Populate a Map<Tag, List<List<Long>>>using Tag.DEFAULT_BACKEND_TAG and return ColocationGroupBackendSeqsProcNode.
This ensures proc output remains meaningful and functional in Cloud mode while keeping the original behavior unchanged for non-cloud deployments.
Behavior changes
Previous behavior:
SHOW PROC '/colocation_group/{dbId}.{groupId} ' always relied on ColocateTableIndex.getBackendsPerBucketSeq(groupId), regardless of deployment mode.
In Cloud mode, this could fail or produce invalid/unusable backend sequences.
Current behavior:
In non-cloud mode, behavior is unchanged.
In Cloud mode, backend sequences are derived by resolving per-bucket backend IDs via CloudReplica.getBackendId(), and the proc now reports a valid backend sequence under DEFAULT_BACKEND_TAG.
Rationale:
Cloud mode requires backend resolution through cloud-specific mapping logic rather than the classic colocate backend sequence computation.
Possible impact:
The change affects only the FE-side proc implementation for colocation group backend sequences in Cloud mode.
Error handling is stricter in Cloud mode: missing group or empty group now results in clear AnalysisException messages.
New features
N/A
Refactoring
N/A
Optimization
N/A
Tests
Manual verification:
Verified SHOW PROC '/colocation_group still works as before.
Verified SHOW PROC '/colocation_group/{dbId}.{groupId}' returns backend sequences correctly in Cloud mode, and produces appropriate errors for:
non-existent group (Group does not exist)
group with no tables (No table in colocate group)
compute group resolution failures (propagated as AnalysisException with the underlying message).
原始邮件
发件人:Dongyang Li ***@***.***>
发件时间:2025年12月25日 11:53
收件人:apache/doris ***@***.***>
抄送:sgy861 ***@***.***>, Author ***@***.***>
主题:Re: [apache/doris] Issue Number: #55756 (PR #59350)
hello-stephen left a comment (apache/doris#59350)
Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.
Please clearly describe your PR:
What problem was fixed (it's best to include specific error reporting information). How it was fixed.
Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
What features were added. Why was this function added?
Which code was refactored and why was this part of the code refactored?
Which functions were optimized and what is the difference before and after the optimization?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
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.
What problem does this PR solve?
Issue Number: #55756
Related PR: N/A
Problem Summary:
In Cloud mode,
SHOW PROC '/colocation_group/<groupId>'returns empty results even when the colocation group is stable and has valid bucket placement.In non-cloud mode, this statement correctly shows the bucket-to-backend distribution of a colocation group. However, in Cloud mode, the proc lookup fails to resolve colocated backend IDs, resulting in no rows being returned.
This PR fixes the proc lookup logic to correctly resolve colocated backend information in Cloud mode by leveraging the cloud replica placement logic (e.g.
CloudReplica#getColocatedBeId). After this fix,SHOW PROC '/colocation_group/<groupId>'behaves consistently between cloud and non-cloud environments.Release note
None
Check List (For Author)
Test
Regression test
Unit Test
Manual test (add detailed scripts or steps below)
No need to test or manual test. Explain why:
Manual test steps
Start a Cloud-mode Doris cluster with at least one available BE.
Create two colocated tables with identical distribution and bucket settings:
Verify the colocate group exists:
SHOW PROC '/colocation_group';Query the colocate group distribution:
SHOW PROC '/colocation_group/<groupId>';Confirm that bucket-to-backend mapping is returned and not empty.
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)