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
MCOL-3577: Make this run syncFS for storagemanager on all nodes when suspend writes is done from mcsadmin.
This commit is contained in:
@ -3232,6 +3232,10 @@ void Oam::SuspendWrites(GRACEFUL_FLAG gracefulflag, ACK_FLAG ackflag)
|
|||||||
cout << endl << " Suspension of database writes canceled" << endl << endl;
|
cout << endl << " Suspension of database writes canceled" << endl << endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case API_FAILURE:
|
||||||
|
cout << endl << " Suspension of database writes failed: Filesystem sync failed" << endl << endl;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
exceptionControl("suspendWrites", returnStatus);
|
exceptionControl("suspendWrites", returnStatus);
|
||||||
break;
|
break;
|
||||||
|
@ -581,7 +581,8 @@ enum PROC_MGT_TYPE_REQUEST
|
|||||||
DISABLEREP,
|
DISABLEREP,
|
||||||
PROCGLUSTERASSIGN,
|
PROCGLUSTERASSIGN,
|
||||||
PROCGLUSTERUNASSIGN,
|
PROCGLUSTERUNASSIGN,
|
||||||
CONFIGURE
|
CONFIGURE,
|
||||||
|
SYNCFSALL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2794,7 +2794,78 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
string currentFileName = DBRMroot + "_current";
|
string currentFileName = DBRMroot + "_current";
|
||||||
IDBFileSystem &fs = IDBPolicy::getFs(currentFileName.c_str());
|
IDBFileSystem &fs = IDBPolicy::getFs(currentFileName.c_str());
|
||||||
fs.filesystemSync();
|
|
||||||
|
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++)
|
||||||
|
{
|
||||||
|
if ( systemmoduletypeconfig.moduletypeconfig[i].ModuleType != "pm" )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount;
|
||||||
|
|
||||||
|
if ( moduleCount == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin();
|
||||||
|
|
||||||
|
for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++)
|
||||||
|
{
|
||||||
|
int opState = oam::ACTIVE;
|
||||||
|
bool degraded;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
oam.getModuleStatus((*pt).DeviceName, opState, degraded);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
log.writeLog(__LINE__, "EXCEPTION ERROR on getModuleStatus on module " + (*pt).DeviceName + ": Caught unknown exception!", LOG_TYPE_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 );
|
||||||
|
|
||||||
|
if (returnStatus != API_SUCCESS)
|
||||||
|
{
|
||||||
|
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() on module " + (*pt).DeviceName,LOG_TYPE_ERROR);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ackMsg.reset();
|
ackMsg.reset();
|
||||||
|
@ -2072,6 +2072,19 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SYNCFSALL:
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
mq.write(ackMsg);
|
||||||
|
|
||||||
|
log.writeLog(__LINE__, "SYNCFSALL: ACK back to ProcMgr, return status = " + oam.itoa((int) API_SUCCESS));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -6188,6 +6201,22 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
return oam::API_SUCCESS;
|
return oam::API_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ProcessMonitor::syncFS()
|
||||||
|
{
|
||||||
|
Oam oam;
|
||||||
|
|
||||||
|
string DBRMroot;
|
||||||
|
oam.getSystemConfig("DBRMRoot", DBRMroot);
|
||||||
|
|
||||||
|
string currentFileName = DBRMroot + "_current";
|
||||||
|
IDBFileSystem &fs = IDBPolicy::getFs(currentFileName.c_str());
|
||||||
|
bool success = fs.filesystemSync();
|
||||||
|
if (!success)
|
||||||
|
return oam::API_FAILURE;
|
||||||
|
return oam::API_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
} //end of namespace
|
} //end of namespace
|
||||||
// vim:ts=4 sw=4:
|
// vim:ts=4 sw=4:
|
||||||
|
|
||||||
|
@ -542,6 +542,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
int glusterUnassign(std::string dbrootID);
|
int glusterUnassign(std::string dbrootID);
|
||||||
|
|
||||||
|
int syncFS();
|
||||||
/**
|
/**
|
||||||
* return the process list
|
* return the process list
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user