-
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: fix incomplete shutdown in some cases
This commit fixes an incomplete shutdown of distributed plans in face of "no inbound stream connection" errors. Note that "incomplete" here means allowing some parts of the plan run to completion (rather than leaking resources). Whenever this "no inbound stream connection" error occurs, we send it to the timed out receivers, and eventually the error will make its way to the DistSQLReceiver which transitions the whole plan into the draining state. However, non-timed out streams will only learn about the draining state when they send something on the streams which might not happen for a while (and in case of TTL processors will not happen until completion). This commit addresses this inefficiency by also cancelling the flow on the node to which some streams didn't connect in time. This triggers ungraceful and quick shutdown of the whole plan, and it seems like a more intuitive behavior given that the whole plan still resulted in an error. The only downside of this change that I can see is that now the resulting error can be "query canceled" rather than "no inbound stream" since there could be a race between the original error and the context cancellation error. Release note: None
- Loading branch information
1 parent
a5ed7a0
commit f931435
Showing
3 changed files
with
27 additions
and
7 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