You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Changed the retry behavior in SocketPool to get load_brm to work
when called by proc???. Also made proc??? start/stop SM around save_brm runs. There seems not to be a saner way to do that atm. So, on stop/restart/shutdown, it will do 1) stop everything 2) restart SM 3) save_brm 4) stop SM again
This commit is contained in:
@ -1331,11 +1331,27 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* XXXPAT: saveBRM requires StorageManager being up at the time.
|
||||||
|
A couple options. 1) start/stop SM around saveBRM(). Will work but it means SM would go
|
||||||
|
down-up-down for this single operation. 2) add a special path to stopModule()
|
||||||
|
to NOT stop SM in the first call, then after saveBRM(), stop SM.
|
||||||
|
|
||||||
|
Neither option is great. The least invasive is option 1, so going with that
|
||||||
|
for now.
|
||||||
|
*/
|
||||||
|
|
||||||
//now stop local module
|
//now stop local module
|
||||||
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
||||||
|
|
||||||
//run save brm script
|
//run save brm script
|
||||||
|
string storageType = Config::makeConfig()->getConfig("Installation", "DBRootStorageType");
|
||||||
|
if (storageType == "storagemanager")
|
||||||
|
processManager.startProcess(config.moduleName(), "StorageManager", FORCEFUL);
|
||||||
|
|
||||||
processManager.saveBRM(false);
|
processManager.saveBRM(false);
|
||||||
|
|
||||||
|
if (storageType == "storagemanager")
|
||||||
|
processManager.stopProcess(config.moduleName(), "StorageManager", GRACEFUL, false);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Stop System Completed Success", LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "Stop System Completed Success", LOG_TYPE_INFO);
|
||||||
|
|
||||||
@ -1766,7 +1782,15 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
||||||
|
|
||||||
//run save.brm script
|
//run save.brm script
|
||||||
|
string storageType = Config::makeConfig()->getConfig("Installation", "DBRootStorageType");
|
||||||
|
if (storageType == "storagemanager")
|
||||||
|
processManager.startProcess(config.moduleName(), "StorageManager", FORCEFUL);
|
||||||
|
|
||||||
processManager.saveBRM(false);
|
processManager.saveBRM(false);
|
||||||
|
|
||||||
|
if (storageType == "storagemanager")
|
||||||
|
processManager.stopProcess(config.moduleName(), "StorageManager", GRACEFUL, false);
|
||||||
|
|
||||||
|
|
||||||
log.writeLog(__LINE__, "RESTARTSYSTEM: ACK received from Process-Monitor for stopModule requests, return status = " + oam.itoa(status));
|
log.writeLog(__LINE__, "RESTARTSYSTEM: ACK received from Process-Monitor for stopModule requests, return status = " + oam.itoa(status));
|
||||||
|
|
||||||
@ -7049,7 +7073,7 @@ void ProcessManager::saveBRM(bool skipSession, bool clearshm)
|
|||||||
string cmd = startup::StartUp::installDir() + "/bin/reset_locks " + skip + " > " + logdir + "/reset_locks.log1 2>&1";
|
string cmd = startup::StartUp::installDir() + "/bin/reset_locks " + skip + " > " + logdir + "/reset_locks.log1 2>&1";
|
||||||
int rtnCode = system(cmd.c_str());
|
int rtnCode = system(cmd.c_str());
|
||||||
log.writeLog(__LINE__, "Ran reset_locks", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Ran reset_locks", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Running DBRM save_brm", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Running DBRM save_brm", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
cmd = startup::StartUp::installDir() + "/bin/save_brm > " + logdir + "/save_brm.log1 2>&1";
|
cmd = startup::StartUp::installDir() + "/bin/save_brm > " + logdir + "/save_brm.log1 2>&1";
|
||||||
@ -7061,7 +7085,7 @@ void ProcessManager::saveBRM(bool skipSession, bool clearshm)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
log.writeLog(__LINE__, "Error running DBRM save_brm", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "Error running DBRM save_brm", LOG_TYPE_ERROR);
|
||||||
|
|
||||||
if ( clearshm )
|
if ( clearshm )
|
||||||
{
|
{
|
||||||
cmd = startup::StartUp::installDir() + "/bin/clearShm -c > /dev/null 2>&1";
|
cmd = startup::StartUp::installDir() + "/bin/clearShm -c > /dev/null 2>&1";
|
||||||
|
@ -92,13 +92,14 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
|
|||||||
const uint8_t *inbuf = in.buf();
|
const uint8_t *inbuf = in.buf();
|
||||||
ssize_t err = 0;
|
ssize_t err = 0;
|
||||||
|
|
||||||
|
/* should there be a retry limit here... */
|
||||||
while (sock < 0)
|
while (sock < 0)
|
||||||
{
|
{
|
||||||
sock = getSocket();
|
sock = getSocket();
|
||||||
if (sock < 0)
|
if (sock < 0)
|
||||||
{
|
{
|
||||||
log(logging::LOG_TYPE_ERROR, "SocketPool::send_recv(): retrying in 5 sec...");
|
//log(logging::LOG_TYPE_ERROR, "SocketPool::send_recv(): retrying in 5 sec...");
|
||||||
sleep(5);
|
sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,10 +215,12 @@ int SocketPool::getSocket()
|
|||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
char buf[80];
|
char buf[80];
|
||||||
os << "SocketPool::getSocket() failed to connect; got '" << strerror_r(saved_errno, buf, 80);
|
os << "SocketPool::getSocket() failed to connect; got '" << strerror_r(saved_errno, buf, 80) << "'";
|
||||||
cout << os.str() << endl;
|
cout << os.str() << endl;
|
||||||
log(logging::LOG_TYPE_ERROR, os.str());
|
log(logging::LOG_TYPE_ERROR, os.str());
|
||||||
|
close(clientSocket);
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return clientSocket;
|
return clientSocket;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user