You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-850 - merged from develop-1.0
This commit is contained in:
@@ -2536,25 +2536,48 @@ namespace oam
|
|||||||
|
|
||||||
Oam::getAlarmConfig(alarmid, name, returnValue);
|
Oam::getAlarmConfig(alarmid, name, returnValue);
|
||||||
|
|
||||||
// only allow user to change these levels
|
// only allow user to change these levels
|
||||||
if ( name != "Threshold" &&
|
if ( name != "Threshold" &&
|
||||||
name != "Occurrences" &&
|
name != "Occurrences" &&
|
||||||
name != "LastIssueTime" )
|
name != "LastIssueTime" )
|
||||||
exceptionControl("setAlarmConfig", API_READONLY_PARAMETER);
|
exceptionControl("setAlarmConfig", API_READONLY_PARAMETER);
|
||||||
|
|
||||||
|
string fileName = AlarmConfigFile;
|
||||||
|
|
||||||
|
int fd = open(fileName.c_str(), O_RDWR|O_CREAT, 0644);
|
||||||
|
|
||||||
|
// Aquire an exclusive lock
|
||||||
|
if (flock(fd,LOCK_EX) == -1) {
|
||||||
|
throw runtime_error ("Lock file error: " + fileName);
|
||||||
|
}
|
||||||
|
|
||||||
// write parameter to disk
|
// write parameter to disk
|
||||||
|
|
||||||
Config* alaConfig = Config::makeConfig(AlarmConfigFile.c_str());
|
Config* alaConfig = Config::makeConfig(AlarmConfigFile.c_str());
|
||||||
alaConfig->setConfig(Section, name, value);
|
alaConfig->setConfig(Section, name, value);
|
||||||
try
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
alaConfig->write();
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
// Release lock
|
||||||
|
if (flock(fd,LOCK_UN)==-1)
|
||||||
{
|
{
|
||||||
alaConfig->write();
|
throw runtime_error ("Release lock file error: " + fileName);
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{
|
|
||||||
exceptionControl("setAlarmConfig", API_FAILURE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exceptionControl("setAlarmConfig", API_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Release lock
|
||||||
|
if (flock(fd,LOCK_UN)==-1)
|
||||||
|
{
|
||||||
|
throw runtime_error ("Release lock file error: " + fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
@@ -6970,7 +6993,7 @@ namespace oam
|
|||||||
|
|
||||||
//current amazon max dbroot id support = 190;
|
//current amazon max dbroot id support = 190;
|
||||||
string PMdeviceName = "/dev/sd";
|
string PMdeviceName = "/dev/sd";
|
||||||
string deviceLetter[] = {"g","h","i","j","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","end"};
|
string deviceLetter[] = {"g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","end"};
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
*
|
*
|
||||||
|
@@ -5075,27 +5075,23 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
|
|||||||
{
|
{
|
||||||
Oam oam;
|
Oam oam;
|
||||||
|
|
||||||
//just return of debug set, called from amazonInstaller
|
// cout << "Checking if Volume " << volumeName << " is attached , please wait..." << endl;
|
||||||
if( thread_remote_installer )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
cout << "Checking if Volume " << volumeName << " is attached , please wait..." << endl;
|
|
||||||
|
|
||||||
string status = oam.getEC2VolumeStatus(volumeName);
|
string status = oam.getEC2VolumeStatus(volumeName);
|
||||||
if ( status == "attached" ) {
|
if ( status == "attached" ) {
|
||||||
cout << "Volume " << volumeName << " is attached " << endl;
|
cout << " Volume " << volumeName << " is attached " << endl;
|
||||||
cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
|
// cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( status != "available" ) {
|
if ( status != "available" ) {
|
||||||
cout << "ERROR: Volume " << volumeName << " status is " << status << endl;
|
cout << " ERROR: Volume " << volumeName << " status is " << status << endl;
|
||||||
cout << "Please resolve and re-run postConfigure" << endl;
|
cout << " Please resolve and re-run postConfigure" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << endl;
|
/* cout << endl;
|
||||||
string temp = "y";
|
string temp = "y";
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
@@ -5116,28 +5112,29 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( temp == "y" ) {
|
if ( temp == "y" ) {
|
||||||
cout << "Attaching, please wait..." << endl;
|
*/ cout << " Attaching, please wait..." << endl;
|
||||||
if(oam.attachEC2Volume(volumeName, deviceName, instanceName)) {
|
if(oam.attachEC2Volume(volumeName, deviceName, instanceName)) {
|
||||||
cout << "Volume " << volumeName << " is now attached " << endl;
|
cout << " Volume " << volumeName << " is now attached " << endl;
|
||||||
cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
|
// cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "ERROR: Volume " << volumeName << " failed to attach" << endl;
|
cout << " ERROR: Volume " << volumeName << " failed to attach" << endl;
|
||||||
cout << "Please resolve and re-run postConfigure" << endl;
|
cout << " Please resolve and re-run postConfigure" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
/* }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "Volume " << volumeName << " will need to be attached before completing the install" << endl;
|
cout << "Volume " << volumeName << " will need to be attached before completing the install" << endl;
|
||||||
cout << "Please resolve and re-run postConfigure" << endl;
|
cout << "Please resolve and re-run postConfigure" << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
*/ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool singleServerDBrootSetup()
|
bool singleServerDBrootSetup()
|
||||||
{
|
{
|
||||||
Oam oam;
|
Oam oam;
|
||||||
|
Reference in New Issue
Block a user