Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented May 11, 2025

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

morningman added a commit to apache/doris that referenced this pull request May 26, 2025
…50791)

### What problem does this PR solve?

Related PR: #50776, #46882

Problem Summary:

1. Fix bug that `KILL connection_id` is not supported in Nereids

This PR #46882 implements `KILL` in Nereids, but it miss the grammar
`KILL connection_id` and treat it as `KILL query_id`. This PR fix it.

2. Unify the core code of `KILL` operation in both old and new planner

All core logic about `kill` are moved to `KillUtils` class. So that both
old and new planner and can have same logic.

3. Support Kill query by query id from all FE

Previously, when executing `kill query query_id;`, Doris will only find
query id in current FE. If not found, Doris will send the cancel request
to all Backends to try cancelling this query.

In this PR, I changed the logic. Doris will first find query id in
current FE, if not found, this `kill` command will be forwarded to all
other Frontends to then find it in other FEs. And Doris will no longer
send the cancel request to Backend.

4. Support Kill query by trace id from all FE

User can set a custom `trace id` by `set
session_context="trace_id:your_trace_id"`. And this trace id will be
bind to the subsequent queries in this connection. Then user can cancel
the query by trace id:

    `KILL QUERY "trace_id"`

More details can be found in user doc:
apache/doris-website#2371
@morningman morningman merged commit 588ba67 into apache:master May 26, 2025
1 check passed
koarz pushed a commit to koarz/doris that referenced this pull request Jun 4, 2025
…pache#50791)

### What problem does this PR solve?

Related PR: apache#50776, apache#46882

Problem Summary:

1. Fix bug that `KILL connection_id` is not supported in Nereids

This PR apache#46882 implements `KILL` in Nereids, but it miss the grammar
`KILL connection_id` and treat it as `KILL query_id`. This PR fix it.

2. Unify the core code of `KILL` operation in both old and new planner

All core logic about `kill` are moved to `KillUtils` class. So that both
old and new planner and can have same logic.

3. Support Kill query by query id from all FE

Previously, when executing `kill query query_id;`, Doris will only find
query id in current FE. If not found, Doris will send the cancel request
to all Backends to try cancelling this query.

In this PR, I changed the logic. Doris will first find query id in
current FE, if not found, this `kill` command will be forwarded to all
other Frontends to then find it in other FEs. And Doris will no longer
send the cancel request to Backend.

4. Support Kill query by trace id from all FE

User can set a custom `trace id` by `set
session_context="trace_id:your_trace_id"`. And this trace id will be
bind to the subsequent queries in this connection. Then user can cancel
the query by trace id:

    `KILL QUERY "trace_id"`

More details can be found in user doc:
apache/doris-website#2371
yagagagaga pushed a commit to yagagagaga/doris-website that referenced this pull request Jun 19, 2025
## Versions 

- [x] dev
- [x] 3.0
- [x] 2.1
- [ ] 2.0

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [x] Checked by AI
- [ ] Test Cases Built
morningman added a commit to morningman/doris that referenced this pull request Jun 24, 2025
…pache#50791)

Related PR: apache#50776, apache#46882

Problem Summary:

1. Fix bug that `KILL connection_id` is not supported in Nereids

This PR apache#46882 implements `KILL` in Nereids, but it miss the grammar
`KILL connection_id` and treat it as `KILL query_id`. This PR fix it.

2. Unify the core code of `KILL` operation in both old and new planner

All core logic about `kill` are moved to `KillUtils` class. So that both
old and new planner and can have same logic.

3. Support Kill query by query id from all FE

Previously, when executing `kill query query_id;`, Doris will only find
query id in current FE. If not found, Doris will send the cancel request
to all Backends to try cancelling this query.

In this PR, I changed the logic. Doris will first find query id in
current FE, if not found, this `kill` command will be forwarded to all
other Frontends to then find it in other FEs. And Doris will no longer
send the cancel request to Backend.

4. Support Kill query by trace id from all FE

User can set a custom `trace id` by `set
session_context="trace_id:your_trace_id"`. And this trace id will be
bind to the subsequent queries in this connection. Then user can cancel
the query by trace id:

    `KILL QUERY "trace_id"`

More details can be found in user doc:
apache/doris-website#2371
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant