1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

MCOL-5555 Add support for startreadonly command.

This patch adds support for `startreadonly` command which waits
until all active cpimport jobs are done and then puts controller node to readonly
mode.
This commit is contained in:
Denis Khalikov
2023-10-02 23:46:53 +03:00
committed by Leonid Fedorov
parent 2b20e1de25
commit 3fcb9b66f5
11 changed files with 403 additions and 18 deletions

View File

@ -39,7 +39,10 @@ bool vflg;
void usage(char* c)
{
cerr << "Usage: " << c << " [-vh] status | halt | resume | readonly | readwrite | reload" << endl;
cerr << "Usage: " << c
<< " [-vh] status | halt | resume | readonly | readwrite | reload | startreadonly | "
"forceclearcpimportjobs"
<< endl;
exit(1);
}
@ -115,6 +118,20 @@ void do_status()
errMsg(err);
}
void start_readonly()
{
int err;
err = dbrm.startReadOnly();
errMsg(err);
}
void force_clear_cpimport_jobs()
{
int err;
err = dbrm.forceClearCpimportJobs();
errMsg(err);
}
void do_sysstatus()
{
int err;
@ -172,6 +189,10 @@ int main(int argc, char** argv)
set_readonly(false);
else if (cmd == "reload")
do_reload();
else if (cmd == "startreadonly")
start_readonly();
else if (cmd == "forceclearcpimportjobs")
force_clear_cpimport_jobs();
else if (cmd == "sysstatus")
do_sysstatus();
else