Skip to content

Commit

Permalink
Merge pull request mariadb-corporation#301 from mariadb-corporation/D…
Browse files Browse the repository at this point in the history
…ataRedundancy-MCOLs

Data redundancy mcols
  • Loading branch information
david hill authored Oct 26, 2017
2 parents a1c82cb + 3f7aa93 commit 723620d
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 286 deletions.
49 changes: 45 additions & 4 deletions oam/oamcpp/liboamcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4933,7 +4933,7 @@ namespace oam
{
//give time for ProcMon/ProcMgr to get fully active on new pm
sleep(10);

// build and send msg to restart system
returnStatus = sendMsgToProcMgr(RESTARTSYSTEM, "", FORCEFUL, ACK_YES);

Expand Down Expand Up @@ -5652,6 +5652,46 @@ namespace oam
{
writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR );
}
// check if a copy is available when residePM returns
string pmList = "";
try {
string errmsg;
int ret = glusterctl(oam::GLUSTER_WHOHAS, itoa(subDBRootID), pmList, errmsg);
if ( ret != 0 )
{
writeLog("ERROR: glusterctl failure getting pm list for dbroot " + itoa(subDBRootID) + " , error: " + errmsg, LOG_TYPE_ERROR );
exceptionControl("autoMovePmDbroot", API_INVALID_PARAMETER);
}
}
catch (exception& )
{
writeLog("ERROR: glusterctl failure getting pm list for dbroot " + itoa(subDBRootID), LOG_TYPE_ERROR );
exceptionControl("autoMovePmDbroot", API_INVALID_PARAMETER);
}
catch (...)
{
writeLog("ERROR: glusterctl failure getting pm list for dbroot " + itoa(subDBRootID), LOG_TYPE_ERROR );
exceptionControl("autoMovePmDbroot", API_INVALID_PARAMETER);
}

bool found = false;
boost::char_separator<char> sep(" ");
boost::tokenizer< boost::char_separator<char> > tokens(pmList, sep);
for ( boost::tokenizer< boost::char_separator<char> >::iterator it = tokens.begin();
it != tokens.end();
++it)
{
if ( atoi((*it).c_str()) == residePMID )
{
// found it and can assign the subDBRoot back to residedPM no switch back is needed
found = true;
}
}
// We will go back to this PM
if (!found)
{
subDBRootID = dbrootID;
}
}

//store in move dbroot transaction file
Expand Down Expand Up @@ -6632,7 +6672,7 @@ namespace oam
{
getPmDbrootConfig(atoi(residePMID.c_str()), residedbrootConfigList);

cout << "DBRoot IDs assigned to '" + residePM + "' = ";
cout << endl << "DBRoot IDs assigned to '" + residePM + "' = ";

DBRootConfigList::iterator pt = residedbrootConfigList.begin();
for( ; pt != residedbrootConfigList.end() ;)
Expand All @@ -6650,7 +6690,7 @@ namespace oam
exceptionControl("unassignPmDbrootConfig", API_FAILURE);
}

cout << endl << "Changes being applied" << endl << endl;
cout << "Changes being applied..." << endl;

//remove entered dbroot IDs from reside PM list
DBRootConfigList::iterator pt1 = dbrootlist.begin();
Expand Down Expand Up @@ -6700,6 +6740,7 @@ namespace oam
detachEC2Volume(volumeName);

residedbrootConfigList.erase(pt2);
cout << "DBRoot IDs unassigned from '" + residePM + "' = " + itoa(*pt1) << endl;

break;
}
Expand Down Expand Up @@ -6732,7 +6773,7 @@ namespace oam
if (pt != residedbrootConfigList.end())
cout << ", ";
}
cout << endl;
cout << endl << endl;
}
catch (exception& e)
{
Expand Down
2 changes: 1 addition & 1 deletion oamapps/mcsadmin/mcsadmin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5812,7 +5812,7 @@ int processCommand(string* arguments)

if ( arguments[2] != "y") {
cout << endl << "!!!!! DESTRUCTIVE COMMAND !!!!!" << endl;
string warning = "This command does a stop and remove a module from the MariaDB ColumnStore System";
string warning = "This command removes module(s) from the MariaDB ColumnStore System";
// confirm request
if (confirmPrompt(warning))
break;
Expand Down
Loading

0 comments on commit 723620d

Please sign in to comment.