1
0
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:
david hill
2017-08-09 15:59:43 -05:00
parent df108ca7fb
commit 6ed975d818
2 changed files with 48 additions and 28 deletions

View File

@@ -2542,19 +2542,42 @@ namespace oam
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(); alaConfig->write();
} }
catch(...) catch(...)
{ {
// Release lock
if (flock(fd,LOCK_UN)==-1)
{
throw runtime_error ("Release lock file error: " + fileName);
}
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"};
/*************************************************************************** /***************************************************************************
* *

View File

@@ -5075,16 +5075,12 @@ 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;
} }
@@ -5095,7 +5091,7 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
} }
else else
{ {
cout << endl; /* cout << endl;
string temp = "y"; string temp = "y";
while(true) while(true)
{ {
@@ -5116,10 +5112,10 @@ 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
@@ -5128,15 +5124,16 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
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()
{ {