Backport: Add force option to set endpoint

The new `force=yes` option closes all connections to the server that is
being put into maintenance mode. This will immediately close all open
connections to the server without allowing results to return.
This commit is contained in:
Markus Mäkelä
2019-04-02 09:32:44 +03:00
parent 7fb840ac9e
commit 0cb15976e8
4 changed files with 18 additions and 0 deletions

View File

@ -774,6 +774,11 @@ HttpResponse cb_set_server(const HttpRequest& request)
string errmsg;
if (mxs::server_set_status(server, opt, &errmsg))
{
if (status_is_in_maint(opt) && request.get_option(CN_FORCE) == CN_YES)
{
dcb_hangup_foreach(server);
}
return HttpResponse(MHD_HTTP_NO_CONTENT);
}
else