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

@@ -2536,25 +2536,48 @@ namespace oam
Oam::getAlarmConfig(alarmid, name, returnValue);
// only allow user to change these levels
if ( name != "Threshold" &&
name != "Occurrences" &&
name != "LastIssueTime" )
// only allow user to change these levels
if ( name != "Threshold" &&
name != "Occurrences" &&
name != "LastIssueTime" )
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
Config* alaConfig = Config::makeConfig(AlarmConfigFile.c_str());
alaConfig->setConfig(Section, name, value);
try
try
{
alaConfig->write();
}
catch(...)
{
// Release lock
if (flock(fd,LOCK_UN)==-1)
{
alaConfig->write();
}
catch(...)
{
exceptionControl("setAlarmConfig", API_FAILURE);
throw runtime_error ("Release lock file error: " + fileName);
}
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;
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,27 +5075,23 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
{
Oam oam;
//just return of debug set, called from amazonInstaller
if( thread_remote_installer )
return true;
cout << "Checking if Volume " << volumeName << " is attached , please wait..." << endl;
// cout << "Checking if Volume " << volumeName << " is attached , please wait..." << endl;
string status = oam.getEC2VolumeStatus(volumeName);
if ( status == "attached" ) {
cout << "Volume " << volumeName << " is attached " << endl;
cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
cout << " Volume " << volumeName << " is attached " << endl;
// cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
return true;
}
if ( status != "available" ) {
cout << "ERROR: Volume " << volumeName << " status is " << status << endl;
cout << "Please resolve and re-run postConfigure" << endl;
cout << " ERROR: Volume " << volumeName << " status is " << status << endl;
cout << " Please resolve and re-run postConfigure" << endl;
return false;
}
else
{
cout << endl;
/* cout << endl;
string temp = "y";
while(true)
{
@@ -5116,28 +5112,29 @@ bool attachVolume(string instanceName, string volumeName, string deviceName, str
}
if ( temp == "y" ) {
cout << "Attaching, please wait..." << endl;
*/ cout << " Attaching, please wait..." << endl;
if(oam.attachEC2Volume(volumeName, deviceName, instanceName)) {
cout << "Volume " << volumeName << " is now attached " << endl;
cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
cout << " Volume " << volumeName << " is now attached " << endl;
// cout << "Make sure it's device " << deviceName << " is mounted to DBRoot directory " << dbrootPath << endl;
return true;
}
else
{
cout << "ERROR: Volume " << volumeName << " failed to attach" << endl;
cout << "Please resolve and re-run postConfigure" << endl;
cout << " ERROR: Volume " << volumeName << " failed to attach" << endl;
cout << " Please resolve and re-run postConfigure" << endl;
return false;
}
}
/* }
else
{
cout << "Volume " << volumeName << " will need to be attached before completing the install" << endl;
cout << "Please resolve and re-run postConfigure" << endl;
return false;
}
}
*/ }
}
bool singleServerDBrootSetup()
{
Oam oam;