Cancel message #8
Replies: 1 comment
-
|
Good catch the spec is underspecified on this and §7 should make the mechanism more explicit. The short answer: STOP_SENDING with PG_CANCEL is the in-band signal to the server's QUIC layer that "this session wants to cancel its current query." The server's QUIC layer then triggers the same backend-side cancellation routine that fires today when postmaster receives a valid CancelRequest - i.e., the backend process executing the query receives SIGINT (in stock PG), its handler sets Nothing about the backend-side mechanism changes. What changes is the routing:
For a proxy-model server (§9), the proxy still has classic v3 TCP connections to the backing PostgreSQL, including the One thing worth mentioning since you raised the backend-side question: §7 already addresses the race between query completion and cancel arrival if STOP_SENDING reaches the server when no query is running on that stream, it's a no-op (paragraph 2 of §7). With the cancel signal in-band on the same stream as the query, the ordering guarantee is structural rather than best-effort. You're right that §7 doesn't say any of this clearly. Will update §7 with the routing-vs-mechanism distinction explicit, and promote Thanks - this is exactly the kind of pushback the spec needs before v1.0. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
You mention that cancel will be replaced with stop. However cancel actually cancels the query on the backend. How will that be accomplished?
Beta Was this translation helpful? Give feedback.
All reactions