1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-02 06:13:16 +03:00

fixed issue - shared-nonthing pm outage was calling the move dbroot commands

This commit is contained in:
david hill
2017-07-19 14:11:14 -05:00
parent a6fe6b1345
commit baf6409aad
2 changed files with 28 additions and 42 deletions

View File

@@ -58,6 +58,7 @@ bool HDFS = false;
string localHostName; string localHostName;
string PMwithUM = "n"; string PMwithUM = "n";
string MySQLRep = "n"; string MySQLRep = "n";
string DBRootStorageType = "internal";
// pushing the ACTIVE_ALARMS_FILE to all nodes every 10 seconds. // pushing the ACTIVE_ALARMS_FILE to all nodes every 10 seconds.
const int ACTIVE_ALARMS_PUSHING_INTERVAL = 10; const int ACTIVE_ALARMS_PUSHING_INTERVAL = 10;
@@ -160,7 +161,6 @@ int main(int argc, char **argv)
} }
//hdfs / hadoop config //hdfs / hadoop config
string DBRootStorageType;
try { try {
oam.getSystemConfig( "DBRootStorageType", DBRootStorageType); oam.getSystemConfig( "DBRootStorageType", DBRootStorageType);
} }
@@ -1281,8 +1281,8 @@ void pingDeviceThread()
int status; int status;
// if pm, move dbroots back to pm // if shared pm, move dbroots back to pm
if ( ( moduleName.find("pm") == 0 && !amazon ) || if ( ( moduleName.find("pm") == 0 && !amazon && ( DBRootStorageType != "internal") ) ||
( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) || ( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) ||
( moduleName.find("pm") == 0 && amazon && AmazonPMFailover == "y") ) { ( moduleName.find("pm") == 0 && amazon && AmazonPMFailover == "y") ) {
@@ -1560,8 +1560,9 @@ void pingDeviceThread()
aManager.sendAlarmReport(moduleName.c_str(), MODULE_DOWN_AUTO, SET); aManager.sendAlarmReport(moduleName.c_str(), MODULE_DOWN_AUTO, SET);
// if pm, move dbroots back to pm // if pm, move dbroots back to pm
if ( ( moduleName.find("pm") == 0 && !amazon ) || if ( ( moduleName.find("pm") == 0 && !amazon && ( DBRootStorageType != "internal") ) ||
( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) ) { ( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) ||
( moduleName.find("pm") == 0 && amazon && AmazonPMFailover == "y") ) {
//move dbroots to other modules //move dbroots to other modules
try { try {
log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG);
@@ -1667,9 +1668,9 @@ void pingDeviceThread()
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
// if pm, move dbroots to other pms // if pm, move dbroots to other pms
if ( !amazon || if ( ( moduleName.find("pm") == 0 && !amazon && ( DBRootStorageType != "internal") ) ||
( amazon && AmazonPMFailover == "y") ) { ( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) ||
if( moduleName.find("pm") == 0 ) { ( moduleName.find("pm") == 0 && amazon && AmazonPMFailover == "y") ) {
try { try {
log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG);
oam.autoMovePmDbroot(moduleName); oam.autoMovePmDbroot(moduleName);
@@ -1687,7 +1688,6 @@ void pingDeviceThread()
log.writeLog(__LINE__, "EXCEPTION ERROR on autoMovePmDbroot: Caught unknown exception!", LOG_TYPE_ERROR); log.writeLog(__LINE__, "EXCEPTION ERROR on autoMovePmDbroot: Caught unknown exception!", LOG_TYPE_ERROR);
} }
} }
}
// if Cloud Instance // if Cloud Instance
// state = running, then instance is rebooting, monitor for recovery // state = running, then instance is rebooting, monitor for recovery
@@ -1864,7 +1864,9 @@ void pingDeviceThread()
processManager.removeModule(devicenetworklist, false); processManager.removeModule(devicenetworklist, false);
// if pm, move dbroots to other pms // if pm, move dbroots to other pms
if( moduleName.find("pm") == 0 ) { if ( ( moduleName.find("pm") == 0 && !amazon && ( DBRootStorageType != "internal") ) ||
( moduleName.find("pm") == 0 && amazon && downActiveOAMModule ) ||
( moduleName.find("pm") == 0 && amazon && AmazonPMFailover == "y") ) {
try { try {
log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "Call autoMovePmDbroot", LOG_TYPE_DEBUG);
oam.autoMovePmDbroot(moduleName); oam.autoMovePmDbroot(moduleName);

View File

@@ -55,6 +55,7 @@ extern bool HDFS;
extern string localHostName; extern string localHostName;
extern string PMwithUM; extern string PMwithUM;
extern string AmazonPMFailover; extern string AmazonPMFailover;
extern string DBRootStorageType;
typedef map<string, int> moduleList; typedef map<string, int> moduleList;
extern moduleList moduleInfoList; extern moduleList moduleInfoList;
@@ -8442,14 +8443,6 @@ int ProcessManager::switchParentOAMModule(std::string newActiveModuleName)
log.writeLog(__LINE__, "switchParentOAMModule Function Started", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "switchParentOAMModule Function Started", LOG_TYPE_DEBUG);
string DBRootStorageType = "internal";
{
try{
oam.getSystemConfig("DBRootStorageType", DBRootStorageType);
}
catch(...) {}
}
if ( DBRootStorageType == "internal" && GlusterConfig == "n") { if ( DBRootStorageType == "internal" && GlusterConfig == "n") {
log.writeLog(__LINE__, "ERROR: DBRootStorageType = internal", LOG_TYPE_ERROR); log.writeLog(__LINE__, "ERROR: DBRootStorageType = internal", LOG_TYPE_ERROR);
pthread_mutex_unlock(&THREAD_LOCK); pthread_mutex_unlock(&THREAD_LOCK);
@@ -8735,15 +8728,6 @@ int ProcessManager::OAMParentModuleChange()
log.writeLog(__LINE__, "EXCEPTION ERROR on getSystemConfig: Caught unknown exception!", LOG_TYPE_ERROR); log.writeLog(__LINE__, "EXCEPTION ERROR on getSystemConfig: Caught unknown exception!", LOG_TYPE_ERROR);
} }
// dbroot storage type, do different failover if internal
string DBRootStorageType = "internal";
{
try{
oam.getSystemConfig("DBRootStorageType", DBRootStorageType);
}
catch(...) {}
}
string cmdLine = "ping "; string cmdLine = "ping ";
string cmdOption = " -c 1 -w 5 >> /dev/null"; string cmdOption = " -c 1 -w 5 >> /dev/null";
string cmd; string cmd;