1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Fix non-root gluster commands and undo change in processmonitor that was not meant to be checked in.

This commit is contained in:
Ben Thompson
2017-09-11 17:08:12 -05:00
parent 4c66199d67
commit e75afd3b8f
2 changed files with 29 additions and 23 deletions

View File

@ -5871,11 +5871,6 @@ int ProcessMonitor::checkDataMount()
}
}
if ( dbrootList.size() == 0 && DataRedundancyConfig != "y") {
log.writeLog(__LINE__, "No dbroots are configured in Columnstore.xml file", LOG_TYPE_WARNING);
return API_INVALID_PARAMETER;
}
try{
oam.getSystemConfig("DBRootStorageType", DBRootStorageType);
}
@ -5904,6 +5899,11 @@ int ProcessMonitor::checkDataMount()
}
}
if ( dbrootList.size() == 0 ) {
log.writeLog(__LINE__, "No dbroots are configured in Columnstore.xml file", LOG_TYPE_WARNING);
return API_INVALID_PARAMETER;
}
if ( DBRootStorageType == "hdfs" ||
(DBRootStorageType == "internal" && DataRedundancyConfig == "n") ) {
//create OAM-Test-Flag
@ -6122,7 +6122,7 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
{
Oam oam;
Config* sysConfig = Config::makeConfig();
string command;
std::string errmsg = "";
log.writeLog(__LINE__, "glusterAssign called : " + dbrootID, LOG_TYPE_DEBUG);
@ -6135,9 +6135,17 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
{
moduleIPAddr = sysConfig->getConfig("SystemModuleConfig",dataDupIPaddr);
}
string command = "mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
if ( rootUser)
{
command = "mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
}
else
{
command = "sudo mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
}
int ret = system(command.c_str());
if ( WEXITSTATUS(ret) != 0 )
@ -6169,13 +6177,19 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
int ProcessMonitor::glusterUnassign(std::string dbrootID)
{
Oam oam;
string command;
std::string errmsg = "";
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
string command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
if ( rootUser)
{
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
}
else
{
command = "sudo umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
}
int ret = system(command.c_str());
if ( WEXITSTATUS(ret) != 0 )
{