1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-3577: Fix messaging for filesytem sync.

This commit is contained in:
benthompson15
2019-11-21 18:50:05 -06:00
parent d377defa31
commit f3dae6bf0d
3 changed files with 46 additions and 31 deletions

View File

@@ -2789,28 +2789,6 @@ void processMSG(messageqcpp::IOSocket* cfIos)
if (storageType == "storagemanager")
{
string DBRMroot;
oam.getSystemConfig("DBRMRoot", DBRMroot);
string currentFileName = DBRMroot + "_current";
IDBFileSystem &fs = IDBPolicy::getFs(currentFileName.c_str());
if (!fs.filesystemSync())
{
ackMsg << (ByteStream::byte) oam::ACK;
ackMsg << actionType;
ackMsg << target;
ackMsg << (ByteStream::byte) API_FAILURE;
try
{
fIos.write(ackMsg);
}
catch (...) {}
log.writeLog(__LINE__, "SUSPENDWRITES: API_FAILURE filestemSync()",LOG_TYPE_ERROR);
break;
}
//sync fs on all pm nodes if up
for ( unsigned int i = 0 ; i < systemmoduletypeconfig.moduletypeconfig.size(); i++)
{
@@ -2841,12 +2819,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
if (opState == oam::MAN_DISABLED || opState == oam::AUTO_DISABLED)
continue;
ByteStream msg;
ByteStream::byte requestID = SYNCFSALL;
msg << requestID;
int returnStatus = processManager.sendMsgProcMon( (*pt).DeviceName, msg, requestID );
int returnStatus = processManager.syncFsAll( (*pt).DeviceName );
if (returnStatus != API_SUCCESS)
{
@@ -11193,6 +11166,35 @@ int ProcessManager::glusterUnassign(std::string moduleName, std::string dbroot)
return returnStatus;
}
/******************************************************************************************
* @brief syncFsALL
*
* purpose: Sync filesystem for backup snapshots on suspenddatabasewrites
*
******************************************************************************************/
int ProcessManager::syncFsAll(std::string moduleName)
{
ByteStream msg;
ByteStream::byte requestID = SYNCFSALL;
msg << requestID;
int returnStatus = sendMsgProcMon( moduleName, msg, requestID, 30 );
if ( returnStatus == API_SUCCESS)
{
//log the success event
log.writeLog(__LINE__, "syncFsALL Success: " + moduleName, LOG_TYPE_DEBUG);
}
else
{
//log the error event
log.writeLog(__LINE__, "syncFsALL FAILED: " + moduleName, LOG_TYPE_ERROR);
}
return returnStatus;
}
} //end of namespace
// vim:ts=4 sw=4:

View File

@@ -556,6 +556,10 @@ public:
*/
int glusterUnassign(std::string moduleName, std::string dbroot);
/** @brief sync filesystem for snapshot backups
*/
int syncFsAll(std::string moduleName);
private:

View File

@@ -2077,9 +2077,18 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
log.writeLog(__LINE__, "MSG RECEIVED: SYNC FileSystem...");
int requestStatus = API_SUCCESS;
requestStatus = syncFS();
ackMsg << (ByteStream::byte) ACK;
ackMsg << (ByteStream::byte) SHUTDOWNMODULE;
ackMsg << (ByteStream::byte) API_SUCCESS;
if (requestStatus == API_SUCCESS)
{
ackMsg << (ByteStream::byte) ACK;
ackMsg << (ByteStream::byte) SYNCFSALL;
ackMsg << (ByteStream::byte) API_SUCCESS;
}
else
{
ackMsg << (ByteStream::byte) ACK;
ackMsg << (ByteStream::byte) SYNCFSALL;
ackMsg << (ByteStream::byte) API_FAILURE;
}
mq.write(ackMsg);
log.writeLog(__LINE__, "SYNCFSALL: ACK back to ProcMgr, return status = " + oam.itoa((int) API_SUCCESS));