Commit 80220f70 authored by unknown's avatar unknown

[PATCH] WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates.

Also add an ERROR_codes.txt file for mgmd

Index: ndb-work/storage/ndb/src/mgmsrv/ERROR_codes.txt
===================================================================


storage/ndb/src/mgmsrv/Services.cpp:
  WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates.
storage/ndb/test/ndbapi/testMgm.cpp:
  WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates.
storage/ndb/src/mgmsrv/ERROR_codes.txt:
  WL#3704 mgmapi timeouts: renumber mgmd err insert to not have duplicates.
parent 446e5b36
Next Session 10
Next Global 10000
#define MGM_ERROR_MAX_INJECT_SESSION_ONLY 10000
Errors < 10000 are per-session only - in MgmApiSession.
Others are for the whole mgm server.
Error 0 is no error
TIMEOUTS
--------
num where type testing
1 get config sleep begin
2 get config sleep middle parsable
3 get config mangle halfway through encoded properties
4 end session sleep before reply
5 node status sleep before reply
6 node status sleep during parsable reply
7 node status sleep after parsable, before status reply
8 node status sleep partway through status reporting
9 node status sleep end of status printing
......@@ -760,7 +760,7 @@ MgmApiSession::endSession(Parser<MgmApiSession>::Context &,
m_allocated_resources= new MgmtSrvr::Allocated_resources(m_mgmsrv);
SLEEP_ERROR_INSERTED(1);
SLEEP_ERROR_INSERTED(4);
m_output->println("end session reply");
}
......@@ -1011,16 +1011,16 @@ MgmApiSession::getStatus(Parser<MgmApiSession>::Context &,
while(m_mgmsrv.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){
noOfNodes++;
}
SLEEP_ERROR_INSERTED(1);
SLEEP_ERROR_INSERTED(5);
m_output->println("node status");
SLEEP_ERROR_INSERTED(2);
SLEEP_ERROR_INSERTED(6);
m_output->println("nodes: %d", noOfNodes);
SLEEP_ERROR_INSERTED(3);
SLEEP_ERROR_INSERTED(7);
printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_NDB);
printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_MGM);
SLEEP_ERROR_INSERTED(4);
SLEEP_ERROR_INSERTED(8);
printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_API);
SLEEP_ERROR_INSERTED(5);
SLEEP_ERROR_INSERTED(9);
nodeId = 0;
......
......@@ -223,8 +223,11 @@ int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step)
ndb_mgm_set_connectstring(h, mgm);
ndbout << "TEST timout check_connection" << endl;
for(int error_ins=1; error_ins<=3; error_ins++)
int errs[] = { 1, 2, 3, -1};
for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++)
{
int error_ins= errs[error_ins_no];
ndbout << "trying error " << error_ins << endl;
ndb_mgm_connect(h,0,0,0);
......@@ -289,7 +292,7 @@ int runTestApiTimeoutBasic(NDBT_Context* ctx, NDBT_Step* step)
ndbout << "TEST end_session" << endl;
ndb_mgm_connect(h,0,0,0);
if(ndb_mgm_insert_error(h, mgmd_nodeid, 1, &reply)< 0)
if(ndb_mgm_insert_error(h, mgmd_nodeid, 4, &reply)< 0)
{
ndbout << "FAILED: insert error 1" << endl;
result= NDBT_FAILED;
......@@ -338,8 +341,11 @@ int runTestApiGetStatusTimeout(NDBT_Context* ctx, NDBT_Step* step)
h= ndb_mgm_create_handle();
ndb_mgm_set_connectstring(h, mgm);
for(int error_ins=0; error_ins<=5; error_ins++)
int errs[] = { 0, 5, 6, 7, 8, 9, -1 };
for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++)
{
int error_ins= errs[error_ins_no];
ndb_mgm_connect(h,0,0,0);
if(ndb_mgm_check_connection(h) < 0)
......@@ -381,19 +387,19 @@ int runTestApiGetStatusTimeout(NDBT_Context* ctx, NDBT_Step* step)
* so we don't break any behaviour
*/
if(error_ins!=0 && error_ins!=5 && cl!=NULL)
if(error_ins!=0 && error_ins!=9 && cl!=NULL)
{
ndbout << "FAILED: got a ndb_mgm_cluster_state back" << endl;
result= NDBT_FAILED;
}
if(error_ins!=0 && error_ins!=5 && ndb_mgm_is_connected(h))
if(error_ins!=0 && error_ins!=9 && ndb_mgm_is_connected(h))
{
ndbout << "FAILED: is still connected after error" << endl;
result= NDBT_FAILED;
}
if(error_ins!=0 && error_ins!=5 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT)
if(error_ins!=0 && error_ins!=9 && ndb_mgm_get_latest_error(h)!=ETIMEDOUT)
{
ndbout << "FAILED: Incorrect error code (" << ndb_mgm_get_latest_error(h)
<< " != expected " << ETIMEDOUT << ") desc: "
......@@ -422,8 +428,11 @@ int runTestMgmApiGetConfigTimeout(NDBT_Context* ctx, NDBT_Step* step)
h= ndb_mgm_create_handle();
ndb_mgm_set_connectstring(h, mgm);
for(int error_ins=0; error_ins<=3; error_ins++)
int errs[] = { 0, 1, 2, 3, -1 };
for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++)
{
int error_ins= errs[error_ins_no];
ndb_mgm_connect(h,0,0,0);
if(ndb_mgm_check_connection(h) < 0)
......@@ -499,8 +508,11 @@ int runTestMgmApiEventTimeout(NDBT_Context* ctx, NDBT_Step* step)
h= ndb_mgm_create_handle();
ndb_mgm_set_connectstring(h, mgm);
for(int error_ins=0; error_ins<=3; error_ins++)
int errs[] = { 0, -1 };
for(int error_ins_no=0; errs[error_ins_no]!=-1; error_ins_no++)
{
int error_ins= errs[error_ins_no];
ndb_mgm_connect(h,0,0,0);
if(ndb_mgm_check_connection(h) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment