-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flowinfra: cancel remote flows when node is drained
This commit fixes an oversight in the draining process of the DistSQL flows. Previously, it was possible for some flows to keep on running even after `server.shutdown.query_wait` has passed (which acts as a grace period to allow queries to complete). This only affects the distributed queries since local queries are already canceled when the connections to the node being drained are interrupted. This commit makes it so that the flow registry actively cancels all still running flows after the query wait grace period. This is done by canceling the context of the flow. As a result, distributed queries that have flows on the node being drained now will result in an error (previously, they could stall the draining process until they would complete). Additionally, this commit fixes an oversight introduced in 5ff1974 so that all flows (except for fully-local queries) get registered with the flow registry. This matters for remote flows that don't have any inbound connections (e.g. `SELECT count(*)` query or a CDC flow) which would previously by-pass the flow registry altogether. In order to have an escape hatch in case the new behavior becomes problematic, a new private cluster setting is introduced that can disable the new behavior of canceling the still running flows. Release note: None
- Loading branch information
1 parent
9650b0d
commit 7ae1e25
Showing
7 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters