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,sql: implement connection_wait for graceful draining
Currently, the draining process is consist of three consecutive periods: - `drain_wait`: The `/health?ready=1` starts to show that the node is shutting down. New SQL connections and new queries are allowed. The server does a hard wait till the timeout. - `query_wait`: New SQL connections are not allowed. SQL Connections with no queries in flight will be closed by the server immediately. The rest of these SQL connections will be terminated by the server as soon as their queries are finished. Early exit if all queries are finished. - `lease_transfer_wait`: Wait to transfer range leases. The server does a hard wait till the timeout. This commit reorganizes the draining process by adding a connection_wait period, and slightly modifying the existing ones: - `drain_wait`: The `/health?ready=1` starts to show that the node is shutting down. New SQL connections and new queries are allowed. The server does a hard wait till the timeout. - `connection_wait`: Wait until all SQL connections are closed or timeout. New SQL connections are not allowed. Existing SQL connections and new queries are allowed. We do an early exist if all SQL connections are closed by the user. - `query_wait`: SQL connections with no queries in flight will be closed by the server immediately. The rest of these SQL connections will be terminated by the server as soon as their queries are finished. Early exit if all queries are finished. - `lease_transfer_wait`: Wait to transfer range leases. The server does a hard wait till the timeout. The duration of `connection_wait` can be set similarly to the other 3 variables: ``` SET CLUSTER SETTING server.shutdown.connection_wait = '40s' ``` Resolves cockroachdb#66319 Release note: TBD
- Loading branch information
1 parent
5359e54
commit e8204af
Showing
3 changed files
with
128 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