config, server: Add graceful shutdown option#20649
Conversation
|
LGTM |
|
/merge |
|
/run-all-tests |
|
@nullnotnil merge failed. |
|
Can we cherry-pick this into release-4.0 branch, so users can use this in the next release version? |
There was a problem hiding this comment.
If I use time.Duration it will imply the value in config.toml is in nanoseconds. For an example, see max-batch-wait-time. I think because the graceful time is usually quite high (10s+) it will look quite strange in nanoseconds.
There are also some other time units which are specified as string (example: lease).
|
/run-all-tests |
|
/run-all-tests |
1 similar comment
|
/run-all-tests |
|
/run-unit-test |
2 similar comments
|
/run-unit-test |
|
/run-unit-test |
ref pingcap/tidb#20649 Add this config support like this: ``` tidb: readinessProbe: statusAPI: {} ``` This will make tidb pod use Exec handle to run curl probe the url 127.0.0.1:10080/status Default still use TCPPPort(4000) for compatibility
ref pingcap/tidb#20649 Add this config support like this: ``` tidb: readinessProbe: statusAPI: {} ``` This will make tidb pod use Exec handle to run curl probe the url 127.0.0.1:10080/status Default still use TCPPPort(4000) for compatibility
|
/run-unit-test |
|
/run-unit-test |
|
/merge |
|
/run-all-tests |
|
@nullnotnil merge failed. |
|
It looks like merge failed because errors.toml differs, which is caused by pingcap/tiup#867 merging. I have added it to this PR, but if another PR merges first it will likely have to fix this. |
|
/run-all-tests |
|
/run-unit-test |
1 similar comment
|
/run-unit-test |
|
/merge |
|
/run-all-tests |
|
@nullnotnil merge failed. |
|
/run-integration-ddl-test |
|
/run-unit-test |
|
/merge |
|
/run-all-tests |
|
The tests now pass, but it's not merging because it lost approval when new code was added to fix the |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
cherry pick to release-4.0 in PR #20814 |
What problem does this PR solve?
Issue Number: Fixes #20619
Problem Summary:
Shutting down the server immediately is problematic in load balancing scenarios. The load balancer may not detect the instance has shutdown fast enough and continue to route stray requests. Requests already in flight may also be terminated.
This PR adds a server configuration option to start returning "unhealthy" to the load balancer health check. It will wait
Nseconds before starting the shutdown procedure (default: 0, maintains compatibility).What is changed and how it works?
What's Changed:
A configuration option has been added for
GracefulWaitBeforeShutdown.How it Works:
If
GracefulWaitBeforeShutdown> 0, the server will set the load balancer status to unhealthy and then wait this many seconds before starting the shutdown procedure.Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note
graceful-wait-before-shutdownallows you to specify the number of seconds to wait before starting the shutdown procedure.