Skip to content

[BugFix] Fix query cache conflicts local shuffle agg#73194

Open
stdpain wants to merge 1 commit into
StarRocks:mainfrom
stdpain:local_shuffle_agg
Open

[BugFix] Fix query cache conflicts local shuffle agg#73194
stdpain wants to merge 1 commit into
StarRocks:mainfrom
stdpain:local_shuffle_agg

Conversation

@stdpain
Copy link
Copy Markdown
Contributor

@stdpain stdpain commented May 13, 2026

Why I'm doing:

Query cache require assign tablet to per drivers. But local shuffle agg will blocking cannot work without could_local_shufle=false.

In this patch we disable the local shuffle agg when enable the query cache.

What I'm doing:

Fixes #73183

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 pr needs auto generate documentation
  • 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.1
    • 4.0
    • 3.5
    • 3.4

Query cache require assign tablet to per drivers. But local shuffle agg
will blocking cannot work without could_local_shufle=false.

Signed-off-by: stdpain <drfeng08@gmail.com>
@stdpain stdpain requested a review from a team as a code owner May 13, 2026 05:10
@CelerData-Reviewer
Copy link
Copy Markdown

@codex review

@github-actions github-actions Bot requested a review from stephen-shelby May 13, 2026 05:13
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e094cba60

ℹ️ 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".

CONCAT('cat-', CAST(generate_series % 10 AS STRING))
FROM TABLE(generate_series(1, 1000));

SELECT category, COUNT(*) FROM t1 GROUP BY category ORDER BY category limit 10; No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enable query cache in this regression case

This test never turns on query cache and executes the aggregate query only once, so it does not exercise the cache populate/probe path that the fix targets; enable_query_cache is false by default, which means the local-shuffle/query-cache interaction is not validated here. As written, the case can pass even if the original conflict still exists, so it should explicitly enable query cache (for example with SET_VAR) and rerun the same query to force a cache hit path.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link
Copy Markdown
Contributor

[FE Incremental Coverage Report]

pass : 3 / 3 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/optimizer/task/EnforceAndCostTask.java 1 1 100.00% []
🔵 com/starrocks/sql/optimizer/rule/tree/PruneShuffleDistributionNodeRule.java 2 2 100.00% []

@github-actions
Copy link
Copy Markdown
Contributor

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

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.

GROUP BY / SELECT DISTINCT on low-cardinality VARCHAR returns N duplicate groups (N = BUCKETS) when enable_query_cache=true — v4.0.10

4 participants