1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1004 from pleblanc1976/runtime-disable-oam

Runtime disable oam
This commit is contained in:
Andrew Hutchings
2020-01-17 10:31:05 -08:00
committed by Patrick LeBlanc
parent a7724ac3c7
commit 5ff131e726
10 changed files with 81 additions and 82 deletions

View File

@ -716,10 +716,6 @@ IF (NOT INLINE)
SET (inline "")
ENDIF()
IF($ENV{SKIP_OAM_INIT})
set(SKIP_OAM_INIT 1 CACHE BOOL "Skip OAM initialization" FORCE)
ENDIF()
EXECUTE_PROCESS(
COMMAND rm -f conftest.data conftest.file conftest.sym
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -76,10 +76,7 @@
#include <thread>
#include <condition_variable>
#if defined(SKIP_OAM_INIT)
#include "dbrm.h"
#endif
namespace
{
@ -1646,11 +1643,12 @@ int main(int argc, char* argv[])
{
}
}
#if defined(SKIP_OAM_INIT)
if (getenv("SKIP_OAM_INIT"))
{
BRM::DBRM *dbrm = new BRM::DBRM();
dbrm->setSystemQueryReady(true);
delete dbrm;
#endif
}
threadpool::ThreadPool exeMgrThreadPool(serverThreads, 0);
exeMgrThreadPool.setName("ExeMgrServer");

View File

@ -2,9 +2,6 @@
#ifndef TEST_MCSCONFIG_H
#define TEST_MCSCONFIG_H
/* Define to 1 to let the system come up without using OAM */
#cmakedefine SKIP_OAM_INIT 1
/* Define to 1 if you have the `alarm' function. */
#cmakedefine HAVE_ALARM 1

View File

@ -2370,7 +2370,8 @@ void Oam::setProcessStatus(const std::string process, const std::string module,
void Oam::processInitComplete(std::string processName, int state)
{
//This method takes too long on Windows and doesn't do anything there anyway...
#if !defined(_MSC_VER) && !defined(SKIP_OAM_INIT)
if (getenv("SKIP_OAM_INIT") != NULL)
return;
// get current Module name
string moduleName;
oamModuleInfo_t st;
@ -2414,7 +2415,6 @@ void Oam::processInitComplete(std::string processName, int state)
writeLog("processInitComplete: Status update failed", LOG_TYPE_ERROR );
exceptionControl("processInitComplete", API_FAILURE);
#endif
}
/********************************************************************
@ -11197,4 +11197,3 @@ namespace procheartbeat
*/
} // end of namespace
// vim:ts=4 sw=4:

View File

@ -111,7 +111,7 @@ void OamCache::checkReload()
// Restore for Windows when we support multiple PMs
while (it != uniquePids.end())
{
#if !defined(SKIP_OAM_INIT)
if (getenv("SKIP_OAM_INIT") == NULL)
{
try
{
@ -180,10 +180,11 @@ void OamCache::checkReload()
break;
}
}
#else
else
{
pmToConnectionMap[*it] = i++;
moduleIds.push_back(*it);
#endif
}
it++;
}
@ -346,4 +347,3 @@ string OamCache::getModuleName()
}
} /* namespace oam */

View File

@ -174,11 +174,12 @@ void setupSignalHandlers()
int main(int argc, char* argv[])
{
// print a warning if this is a developer build
#ifdef SKIP_OAM_INIT
// print a warning if this is a developer build
if (getenv("SKIP_OAM_INIT"))
{
cout << "SKIP_OAM_INIT is set" << endl;
sleep(2);
#endif
}
#ifndef _MSC_VER
setuid(0); // set effective ID to root; ignore return status
@ -10034,4 +10035,3 @@ bool SendToWES(Oam& oam, ByteStream bs)
return true;
}
// vim:ts=4 sw=4:

View File

@ -711,6 +711,12 @@ int main(int argc, char* argv[])
mysqlSetup();
sleep(5);
if (getenv("SKIP_OAM_INIT"))
{
cout << "SKIP_OAM_INIT is set, so will not start ColumnStore or init the system catalog" << endl;
exit(0);
}
//start on local module
int rtnCode = system(idbstartcmd.c_str());
@ -732,6 +738,12 @@ int main(int argc, char* argv[])
mysqlSetup();
sleep(5);
if (getenv("SKIP_OAM_INIT"))
{
cout << "SKIP_OAM_INIT is set, so will not start ColumnStore or init the system catalog" << endl;
exit(0);
}
//startup mysqld and infinidb processes
cout << endl;
cmd = "clearShm > /dev/null 2>&1";
@ -1175,4 +1187,3 @@ bool uncommentCalpontXml( string entry)
}
// vim:ts=4 sw=4:

View File

@ -3730,9 +3730,11 @@ int main(int argc, char* argv[])
// startup MariaDB ColumnStore
//
#ifdef SKIP_OAM_INIT
if (getenv("SKIP_OAM_INIT"))
{
cout << "SKIP_OAM_INIT is set, so will not start ColumnStore or init the system catalog" << endl;
exit(0);
#endif
}
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ||
pmNumber > 1 )

View File

@ -618,7 +618,8 @@ int RedistributeControlThread::executeRedistributePlan()
try
{
// skip system status check in case no OAM
#if !defined(_MSC_VER) && !defined(SKIP_OAM_INIT)
if (getenv("SKIP_OAM_INIT") == NULL)
{
// make sure system is in active state
bool isActive = false;
@ -644,8 +645,7 @@ int RedistributeControlThread::executeRedistributePlan()
if (noExcept && ((isActive = (systemstatus.SystemOpState == oam::ACTIVE)) == false))
sleep(1);;
}
#endif
}
if (fStopAction)
return RED_EC_USER_STOP;
@ -851,4 +851,3 @@ void RedistributeControlThread::doStopAction()
} // namespace
// vim:ts=4 sw=4:

View File

@ -547,7 +547,7 @@ void WESDHandler::setup()
}
// getModuleStatus will take too long. Also to test in development
#if !defined(_MSC_VER) && !defined(SKIP_OAM_INIT)
if (getenv("SKIP_OAM_INIT") == NULL)
{
vector<unsigned int>& aVec = fRef.fCmdArgs.getPmVec();
@ -578,8 +578,6 @@ void WESDHandler::setup()
}
}
}
#endif
int rtn = fDbrm.getSystemReady();
@ -2997,4 +2995,3 @@ void WESDHandler::setDisconnectFailure(bool Flag)
//------------------------------------------------------------------------------
} /* namespace WriteEngine */