Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 30, 2025

Why I'm doing:

#26726 may create mv with many buckets(200/500) if there are many compute nodes(eg: 30) which will cause the culster unstable because of huge metadata in FE.

The current implementation hasn't taken hash/random distribution yet and may generate too many tablets:

public void inferDistribution(DistributionInfo info) throws DdlException {
    if (info.getBucketNum() == 0) {
        int inferredBucketNum = 0;
        for (BaseTableInfo base : getBaseTableInfos()) {
            Optional<Table> optTable = MvUtils.getTable(base);
            if (optTable.isEmpty()) {
                continue;
            }
            Table table = optTable.get();
            if (table.isNativeTableOrMaterializedView()) {
                OlapTable olapTable = (OlapTable) table;
                DistributionInfo dist = olapTable.getDefaultDistributionInfo();
                inferredBucketNum = Math.max(inferredBucketNum, dist.getBucketNum());
            }
        }
        if (inferredBucketNum == 0) {
            inferredBucketNum = CatalogUtils.calBucketNumAccordingToBackends();
        }
        info.setBucketNum(inferredBucketNum);
    }
}

What I'm doing:

Use OlapTable's implementation (#38763) to deduce mv's default bucket by default.

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
    • 4.0
    • 3.5
    • 3.4
    • 3.3

This is an automatic backport of pull request #63367 done by [Mergify](https://mergify.com).

…policy (#63367)

Signed-off-by: shuming.li <[email protected]>
(cherry picked from commit caface7)
Copy link
Contributor Author

mergify bot commented Sep 30, 2025

🧪 CI Insights

Here's what we observed from your CI run for ef1e54f.

🟢 All jobs passed!

But CI Insights is watching 👀

@wanpengfei-git wanpengfei-git merged commit 1293733 into branch-3.5 Oct 7, 2025
55 of 58 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.5/pr-63367 branch October 7, 2025 10:06
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.

2 participants