You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +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,12 +1331,28 @@ 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);
|
||||||
|
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||||
@@ -1766,8 +1782,16 @@ 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));
|
||||||
|
|
||||||
startsystemthreadStop = false;
|
startsystemthreadStop = false;
|
||||||
|
@@ -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