diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-03-21 14:47:10 +0100 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-03-21 14:47:10 +0100 |
commit | 8ed36cb667b675244f55072cefa15fb65ec89ee7 (patch) | |
tree | ea6f3eb4ed5449560230a164a6976d3cf855dbd0 /ndb/test/src | |
parent | 591aedaa2b594fdccca79a09c846cf4b4490f884 (diff) | |
download | mariadb-git-8ed36cb667b675244f55072cefa15fb65ec89ee7.tar.gz |
ndb - bug#18385
Partial system restart, can not try to start with higher GCI that own
even if knowing about a higher number
ndb/include/kernel/signaldata/DumpStateOrd.hpp:
Add new dump for setting time between gcp
ndb/include/kernel/signaldata/StartPerm.hpp:
Move error codes into StartPerm + Add new error code
ndb/src/kernel/blocks/ERROR_codes.txt:
Add new error insert
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
Move error codes into StartPerm + Add new error code
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Fix so that we don't try to restart to a too new GCI when doing a partial start
Add new error code when this node later tries to join
ndb/test/include/NdbRestarter.hpp:
Add new method for selecting random node
ndb/test/ndbapi/testSystemRestart.cpp:
Add new testcase for bug#18385
ndb/test/run-test/daily-basic-tests.txt:
Run test in daily-basic
ndb/test/src/NdbRestarter.cpp:
Add new method for selecting random node
Diffstat (limited to 'ndb/test/src')
-rw-r--r-- | ndb/test/src/NdbRestarter.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 91c0963feae..2c16a05240d 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -174,6 +174,39 @@ NdbRestarter::getRandomNodeOtherNodeGroup(int nodeId, int rand){ return -1; } +int +NdbRestarter::getRandomNodeSameNodeGroup(int nodeId, int rand){ + if (!isConnected()) + return -1; + + if (getStatus() != 0) + return -1; + + int node_group = -1; + for(size_t i = 0; i < ndbNodes.size(); i++){ + if(ndbNodes[i].node_id == nodeId){ + node_group = ndbNodes[i].node_group; + break; + } + } + if(node_group == -1){ + return -1; + } + + Uint32 counter = 0; + rand = rand % ndbNodes.size(); + while(counter++ < ndbNodes.size() && + (ndbNodes[rand].node_id == nodeId || + ndbNodes[rand].node_group != node_group)) + rand = (rand + 1) % ndbNodes.size(); + + if(ndbNodes[rand].node_group == node_group && + ndbNodes[rand].node_id != nodeId) + return ndbNodes[rand].node_id; + + return -1; +} + int NdbRestarter::waitClusterStarted(unsigned int _timeout){ return waitClusterState(NDB_MGM_NODE_STATUS_STARTED, _timeout); |