Skip to content

[Feature]: list running DQL requests and cancel a request by id #53509

Open

Description

@czs007

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

Operators have no way to see which Search / HybridSearch / Query requests are currently executing in a cluster, nor to stop one of them. When a heavy request occupies a QueryNode, the only options today are to wait for the client's own timeout (if the client set one) or to restart components.

Milvus already has an end-to-end cancellation path driven by the client's gRPC deadline: proxy task ctx → QueryNode scheduler → cgo future → segcore checkCancellation → knowhere / cardinal per-query checks. What is missing is a server-side way to trigger that path for a specific request, plus a way to list the in-flight requests it could be triggered on.

Describe the solution you'd like.

Two cluster-scoped RPCs:

  • ListRunningRequests: returns the requests currently registered on every proxy (request id, proxy id, type, db, collection, user, client address, nq, topk, expression prefix, start time, queued time, elapsed time, state, task ids, trace id, cancellable), with optional db / collection / user / minimum elapsed filters.
  • CancelRequests: cancels the given request ids. Cancelling a request cancels its root context, so every proxy sub-task and every QueryNode sub-request of that RPC stop together. The client receives a dedicated non-retriable error code (ErrRequestCancelled).

Supporting changes: a per-proxy request registry keyed by a request id from the proxy's ID allocator; proxy → MixCoord → all-proxy fan-out reusing the ClearReadTaskQueue path; two new global privileges; the proxy load balancer must stop blacklisting a QueryNode when the request's own ctx is already cancelled; a counter and an audit log line per cancellation.

No server-side automatic cancellation (no max execution time, no admission-time rejection): request lifetime stays under the client's timeout.

Describe an alternate solution.

Rely solely on client-side timeouts. This does not cover clients that set no timeout and gives operators no visibility or manual control.

Anything else? (Additional Context)

Design document PR to follow. Related existing defect: #53508 (cancellation of one request fails every request merged into the same QueryNode search group), which must be fixed independently for cancellation to be isolated per request.

Activity

  1. added
    kind/feature
    on Sep 16, 2026
  2. 36 remaining items

  3. czs007 commented on Nov 6, 2026

    @czs007
    CollaboratorAuthor

    Local rerun of the full end-to-end campaign (the 2026-10-22 steps plus the 2026-10-23 additions) after #54276 was rebased onto master 105fa7a, which includes #52977 (QueryView). Build under test: #54276 at 954be1e; pymilvus#3884 at c8d38e73. Baseline for the upgrade steps: master 105fa7a without the PR.

    Result: every applicable step passed. 5 steps are not applicable on the QueryView path (merged-group, client disconnect x4). No regression found.

    Setup

    • Standalone instances (woodpecker): qvplain (authorization off), qvauth (authorization on, PROXY_MAXTASKNUM=5), qvgrp (QueryNode grouping forced), qvold (built from the baseline, for the reverse upgrade).
    • Search and Query go through the QueryView client (internal/views/queryclient) on the proxy and internal/querynodev2/viewquery on the QueryNode.
    • Data: cancel_e2e, 100,000 rows x 768 dims, FLAT and HNSW.
    • Clients: REST, raw gRPC stubs regenerated from milvus-proto 3c2afcb (string request ids), pymilvus#3884 sync and async, the Go SDK.

    Steps

    step 10-22 / 10-23 this run
    basic REST list/cancel, client gets 3002, milvus_proxy_request_canceled_total +1 ✅ ✅
    raw gRPC: row fields, unknown id -> not_found, empty list rejected (1101), real cancel ✅ ✅
    string ids end to end: gRPC, REST read through Node JSON.parse, cause="cancel" request metrics — ✅ 14/14
    Query and HybridSearch listed with the right type and canceled ✅ ✅
    an id twice in one call, and again after it left ✅ ✅
    Canceling observed between cancel and departure (best effort) ✅ Running 763 ✅ Running 539, Canceling 1
    request shapes (variants) ✅ 7/7 ✅ 7/7
    second proxy; list/cancel through the proxy not running the request; one proxy SIGKILLed ✅ ✅
    QueryNode stop after a cancel, FLAT x3 ✅ ✅ 5 / 8 / 12 ms
    QueryNode stop after a cancel, HNSW x3 ✅ ✅ 18 / 10 / 13 ms
    storm, 20 rounds x 10 concurrent searches canceled in one call ✅ list p50 11 ms, cancel p50 4 ms ✅ list p50 9 ms / max 739 ms, cancel p50 7 ms / max 18 ms, registry drains in ≤10 ms, counter +200
    QueryNode read pool idle after the storm ✅ ✅ read_task_ready_len 0
    no new replica / dead-node / blacklist warnings ✅ 2 -> 2 ✅ 1 -> 1
    rolling upgrade: a baseline proxy joins ✅ 11/0 ✅ old proxy reported unimplemented in node_results, unknown id still not_found, client gets 3002
    reverse upgrade: this proxy joins a baseline cluster ✅ ✅ searches work; REST list/cancel answer a non-zero code within 10 s; the running search is not disturbed
    RBAC: privilege decisions, privilege groups, collection-scoped grant ✅ ✅
    self-service: own requests only, REST and gRPC ✅ 15/0 ✅
    recorded case catalogue ✅ 26/26 ✅ 27/27
    pymilvus#3884, sync and async ✅ ✅
    Go SDK ✅ 2/2 ✅ 2/2
    merged-group cancel isolation (#53580) ✅ not applicable
    client disconnect inside a merged group x4 ⚠️ / ✅ not applicable
    60-minute soak ✅ ✅ (below)

    Not applicable. On the QueryView path the QueryNode runs tasks.NewSearchTask(...).ExecuteOnSegments directly from viewquery, without the read-task scheduler, so no merged groups form (the probe saw groups of 0 tasks). The canceled client in that probe still got 3002.

    QueryNode stop, how it was measured. On 10-22 the number came from milvus_querynode_read_task_execute_duration{outcome="cancel"} (task start to stop). The QueryView path does not write that metric, so this run measures from the proxy audit line (request canceled by operator) to the last segcore Brute force search fail: cancelled by the caller line, i.e. cancel to stop. The two numbers measure different intervals.

    60-minute soak

    10-23 this run
    normal searches ok / error 1,772,024 / 0 1,741,486 / 0
    canceled searches 3002 / other 316,765 / 0 325,335 / 0
    normal QPS (mean) 492.2 483.7
    cancels per second (mean) 88.0 90.4
    proxy RSS MB, start / Q2 / Q4 / end 1354 / 1434 / 1430 / 1437 1553 / 1423 / 1415 / 1363
    proxy heap MB 121 / 224 / 223 / 252 134 / 289 / 245 / 154
    goroutines 1340 / 1336 / 1329 / 1307 1415 / 1486 / 1468 / 1448
    registry max / at the end 9 / 0 10 / 0
    canceled_total moved by = canceled = canceled

    CI

    #54276 at 954be1e: build-ut-cov (UT-C++ 23004/23004, Go diff coverage 74.8%), e2e-default and go-sdk all pass; ci-passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions