Re: MonetDB: mosaic - Get rid of MCstartMaintenance and MCexitMainte...
I suggest to keep these functions available in the code base. They may be needed soon and are easier to control then using monetdb stop <db> On 17/09/2019 17:41, Aris Koning wrote:
Changeset: b9c74a8bec29 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b9c74a8bec29 Modified Files: clients/Tests/exports.stable.out monetdb5/mal/mal_client.c monetdb5/mal/mal_client.h Branch: mosaic Log Message:
Get rid of MCstartMaintenance and MCexitMaintenance.
diffs (99 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1449,7 +1449,6 @@ str MBMuniform(bat *ret, oid *base, lng int MCactiveClients(void); str MCawakeClient(int id); void MCcloseClient(Client c); -str MCexitMaintenance(Client cntxt); Client MCforkClient(Client father); Client MCgetClient(int id); bool MCinit(void); @@ -1457,7 +1456,6 @@ Client MCinitClient(oid user, bstream *f int MCinitClientThread(Client c); int MCpushClientInput(Client c, bstream *new_input, int listing, char *prompt); int MCshutdowninprogress(void); -str MCstartMaintenance(Client cntxt, lng timeout, int abort); void MCstopClients(Client c); str MCsuspendClient(int id); int MCvalid(Client c); diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c --- a/monetdb5/mal/mal_client.c +++ b/monetdb5/mal/mal_client.c @@ -518,64 +518,6 @@ MCawakeClient(int id) }
/* - * Server maintenance modes without stopping it completery calls for care. - * Any new client connection should be temporily be refused - * and all clients should stop at a MAL instruction. - * In rare cases, all running queries should be aborted. - */ -str -MCstartMaintenance(Client cntxt, lng timeout, int abort) -{ - int active=1; - Client c = mal_clients; - (void) abort; - - MT_lock_set(&mal_contextLock); - for(c= mal_clients +1; c < mal_clients+MAL_MAXCLIENTS; c++) - if( cntxt != c) - c-> itrace = 'S'; - // wait for all running users to stop - while (active && timeout > 0){ - active = 0; - for(c= mal_clients +1; c < mal_clients+MAL_MAXCLIENTS; c++) - if( cntxt!= c && c->mode == RUNCLIENT){ - if (abort ){ - c->mode = FINISHCLIENT; - active++; - } else - if( cntxt != c) - active += c->itrace == 'S'; - } else - if (cntxt!= c && c->mode == FINISHCLIENT) - active++; - if( active == 0) - break; - MT_sleep_ms(1000); - timeout--; - } - if( timeout == 0 && active){ - for(c= mal_clients +1; c < mal_clients+MAL_MAXCLIENTS; c++) - if( c->itrace == 'W' || c->itrace == 'S') - c->itrace = 0; - throw(MAL,"clients.startmaintenance","timeout"); - } - return MAL_SUCCEED; -} - -str -MCexitMaintenance(Client cntxt) -{ - Client c = mal_clients; - (void) cntxt; - - for(c= mal_clients +1; c < mal_clients+MAL_MAXCLIENTS; c++) - if( c->itrace == 'W' || c->itrace == 'S') - c->itrace = 0; - MT_lock_unset(&mal_contextLock); - return MAL_SUCCEED; -} - -/* * Input to be processed is collected in a Client specific buffer. It * is filled by reading information from a stream, a terminal, or by * scheduling strings constructed internally. The latter involves diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h --- a/monetdb5/mal/mal_client.h +++ b/monetdb5/mal/mal_client.h @@ -201,8 +201,6 @@ mal_export str MCsuspendClient(int i mal_export str MCawakeClient(int id); mal_export int MCpushClientInput(Client c, bstream *new_input, int listing, char *prompt); mal_export int MCvalid(Client c); -mal_export str MCstartMaintenance(Client cntxt, lng timeout, int abort); -mal_export str MCexitMaintenance(Client cntxt);
mal_export str PROFinitClient(Client c); mal_export str PROFexitClient(Client c); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
participants (1)
-
Martin Kersten