Skip to content

fix(query): avoid task context for warehouse filter#19993

Open
KKould wants to merge 1 commit into
databendlabs:mainfrom
KKould:fix/task-service-internal-session
Open

fix(query): avoid task context for warehouse filter#19993
KKould wants to merge 1 commit into
databendlabs:mainfrom
KKould:fix/task-service-internal-session

Conversation

@KKould

@KKould KKould commented Jun 10, 2026

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Avoid creating a full task QueryContext only to filter task messages by warehouse
  • Use the same ClusterDiscovery::single_node_cluster(GlobalConfig) path that task context creation already uses for the local cluster
  • Keep task execution sessions as SessionType::MySQL so task SQL behavior, including temporary table support, remains unchanged

This PR is scoped to reducing task scheduling overhead in warehouse filtering. It does not include the storage/cache accounting investigation or fix.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - No SQL behavior change; validated with formatting and compile checks below

Validation:

  • cargo fmt --check
  • git diff --check
  • cargo check -p databend-query

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-bugfix this PR patches a bug in codebase label Jun 10, 2026

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

Copy link
Copy Markdown

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: 60c1471e30

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/service/src/task/session.rs Outdated
@KKould KKould force-pushed the fix/task-service-internal-session branch from 60c1471 to 735f58c Compare June 10, 2026 13:38
@KKould KKould changed the title fix(query): reduce task internal session overhead fix(query): avoid task context for warehouse filter Jun 10, 2026
@KKould

KKould commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@KKould KKould requested review from sundy-li and zhang2014 June 11, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant