Skip to content

Commit 7ea3f1d

Browse files
committed
Bug#36822559 AT: testSystemRestart -n Bug29167 T1 fails in .4node4rpl and .6node3rpl
Issue #1 Problem: Test fail in 4node4rpl (1 node group). Solution: Skip test when there is only one NG. Issue #2 Problem: Test fail in 6node3rpl (2 node group) with timeout. Test idea is to restart, with nostart option, *ALL* nodes in same node group to check if QMGR handles it wrongly as "node group is missing". In the test only two nodes in same node group are restarted, it works for 2 replica setups but, for 4 replica, test hangs waiting cluster to enter a noStart state. Solution: Instead of restart exactly 2 nodes, restart ALL nodes in a given node group. Change-Id: Iafb0511992a553723013e73593ea10540cd03661
1 parent 680f83b commit 7ea3f1d

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

storage/ndb/test/ndbapi/testSystemRestart.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,17 +2006,18 @@ int runBug27434(NDBT_Context *ctx, NDBT_Step *step) {
20062006
int runBug29167(NDBT_Context *ctx, NDBT_Step *step) {
20072007
int result = NDBT_OK;
20082008
NdbRestarter restarter;
2009-
const Uint32 nodeCount = restarter.getNumDbNodes();
2009+
const Uint32 nodeGroupCount = restarter.getNumNodeGroups();
20102010

2011-
if (nodeCount < 4) return NDBT_SKIPPED;
2011+
if (nodeGroupCount < 2) {
2012+
g_info << "Bug29167 - Needs atleast 2 node group to test" << endl;
2013+
return NDBT_SKIPPED;
2014+
}
20122015

20132016
struct ndb_logevent event;
20142017
int master = restarter.getMasterNodeId();
20152018
do {
20162019
int node1 = restarter.getRandomNodeOtherNodeGroup(master, rand());
2017-
int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
2018-
2019-
ndbout_c("node1: %u node2: %u", node1, node2);
2020+
int node1_ng = restarter.getNodeGroup(node1);
20202021

20212022
int val2[] = {DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1};
20222023
restarter.dumpStateAllNodes(val2, 2);
@@ -2028,16 +2029,21 @@ int runBug29167(NDBT_Context *ctx, NDBT_Step *step) {
20282029
ndb_mgm_create_logevent_handle(restarter.handle, filter);
20292030

20302031
while (ndb_logevent_get_next(handle, &event, 0) >= 0 &&
2031-
event.type != NDB_LE_GlobalCheckpointCompleted)
2032-
;
2032+
event.type != NDB_LE_GlobalCheckpointCompleted) {
2033+
ndbout_c("waiting GCP to complete");
2034+
}
20332035

20342036
ndb_mgm_destroy_logevent_handle(&handle);
20352037

20362038
CHECK(restarter.insertErrorInAllNodes(932) == 0);
20372039

2038-
CHECK(restarter.insertErrorInNode(node1, 7183) == 0);
2039-
CHECK(restarter.insertErrorInNode(node2, 7183) == 0);
2040-
2040+
for (int i = 0; i < restarter.getNumDbNodes(); i++) {
2041+
int node_id = restarter.getDbNodeId(i);
2042+
if (restarter.getNodeGroup(node_id) == node1_ng) {
2043+
ndbout_c("Insert error 7183 in node : %i", node_id);
2044+
CHECK(restarter.insertErrorInNode(node_id, 7183) == 0);
2045+
}
2046+
}
20412047
const unsigned int timeout = 300;
20422048
CHECK(restarter.waitClusterNoStart(timeout) == 0);
20432049
restarter.startAll();
@@ -2046,6 +2052,7 @@ int runBug29167(NDBT_Context *ctx, NDBT_Step *step) {
20462052

20472053
return result;
20482054
}
2055+
20492056
int runOneNodeWithCleanFilesystem(NDBT_Context *ctx, NDBT_Step *step) {
20502057
int result = NDBT_OK;
20512058
NdbRestarter restarter;

0 commit comments

Comments
 (0)