forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server,sqlliveness: rework shutting down SQL pods on sqlliveness prob…
…lems This patch changes how stopping the stopper and, in turn, terminating the process happens for tenant SQL pods when the sqlliveness session is expired. Before this patch, the liveness code was calling the Stopper.Stop() directly. This patch replaces that with bubbling up an event up to the cli layer, which is where the logic around terminating the process lives. That guy has more complex shutdown logic - it has the opportunity to perform draining if it wants (or at least it will in cockroachdb#90143), and it also prints a message with the cause of the exit. An alternative considered was to extend the Stopper.Stop() interface somehow with a termination message, and continue to use the stopper as the mechanism used by arbitrary modules to signal the desire to terminate the server. I've decided against it, though, in favor of introducing another mechanism for signaling requests to terminate up to the cli layer, on the argument that the stopper is passed around so widely and used in a lot of non-production libraries, such that it's hard to trace and tell what production modules call Stop() on it and under which circumstances. Also, stopper.Stop() cannot be deadlocks if called from inside a stopper task (and our code generally runs inside stopper tasks), so we'd also need to add a new async stop interface to the stopper. Thus, the goal of this patch is to keep the number of callers to Stopper.Stop() small - right now there are two of them: one in the cli, and one in the drainServer. In a followup patch, I might remove the drainServer call, and then we'd be left with exactly one caller to Stopper.Stop(). Fixes cockroachdb#85540 Release note: None Epic: None
- Loading branch information
1 parent
fb7f5bd
commit 713e324
Showing
16 changed files
with
245 additions
and
135 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
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
Oops, something went wrong.