MXS-2275 Implement [un]softfailing

It is now possible to [un]softfail a Clustrix node via MaxScale
using a Clustrix monitor module command.

In case a node is successfully softfailed, the `Being Drained` bit
will automatically turned on. Similarly, if a node is successfully
unsoftfailed, the `Being Drained` bit will be cleared.
This commit is contained in:
Johan Wikman
2019-01-30 16:12:34 +02:00
parent 2e395c4477
commit cb07687672
3 changed files with 218 additions and 5 deletions

View File

@ -87,6 +87,20 @@ private:
void initiate_delayed_http_check();
bool check_http(Call::action_t action);
bool perform_softfail(SERVER* pServer, json_t** ppError);
bool perform_unsoftfail(SERVER* pServer, json_t** ppError);
enum class Operation
{
SOFTFAIL,
UNSOFTFAIL,
};
bool perform_operation(Operation operation,
SERVER* pServer,
json_t** ppError);
static long now()
{
return mxb::WorkerLoad::get_time_ms();