diff options
author | unknown <stewart@willster.(none)> | 2006-10-05 18:51:13 +1000 |
---|---|---|
committer | unknown <stewart@willster.(none)> | 2006-10-05 18:51:13 +1000 |
commit | db16cae578dd32ee2e66d8746444613c34b1e3e8 (patch) | |
tree | b95cd7b958b532ad93aa61c6d5a0e2408297c383 /ndb/test | |
parent | 81526834b5c4f3c1672bcfc3759592798d68b72e (diff) | |
download | mariadb-git-db16cae578dd32ee2e66d8746444613c34b1e3e8.tar.gz |
BUG#13987 Cluster: Loss of data nodes can cause high CPU usage from ndb_mgmd
smaller patch for 5.0.
complete patch going to 5.1 due to more intrusiveness for 'list sessions' etc
ndb/include/mgmapi/mgmapi.h:
add internal get_fd to use in test
ndb/include/util/InputStream.hpp:
- add this weird startover member to SocketInputStream
- this helps work out if we've read a newline yet and should start inserting
into buffer from the start
ndb/src/common/util/InputStream.cpp:
remove evil, add more.
keep track internally we've retrieved a newline yet (m_startover)
ndb/src/common/util/Parser.cpp:
change way detecting of NoLine
remove some trailing whitespace that was uglying the place up a bit
ndb/src/common/util/socket_io.cpp:
Always retrieve data from the OS so that we instantly get EOF on disconnect
and don't end up spinning looking for a newline.
ndb/src/mgmapi/mgmapi.cpp:
add internal ndb_mgm_get_fd() for internal testing
handle 'node status' a bit better
ndb/test/ndbapi/testMgm.cpp:
Add test for MgmApiSession disconnection (mgmd at 100%)
not fully automated due to smaller patch for 5.0
will be complete in 5.1
Diffstat (limited to 'ndb/test')
-rw-r--r-- | ndb/test/ndbapi/testMgm.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ndb/test/ndbapi/testMgm.cpp b/ndb/test/ndbapi/testMgm.cpp index ef653d3f972..3234117405c 100644 --- a/ndb/test/ndbapi/testMgm.cpp +++ b/ndb/test/ndbapi/testMgm.cpp @@ -21,6 +21,8 @@ #include <NdbRestarter.hpp> #include <Vector.hpp> #include <random.h> +#include <mgmapi.h> +#include <mgmapi_debug.h> int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ @@ -167,6 +169,26 @@ int runTestSingleUserMode(NDBT_Context* ctx, NDBT_Step* step){ return result; } +int runTestApiSession(NDBT_Context* ctx, NDBT_Step* step) +{ + char *mgm= ctx->getRemoteMgm(); + + NdbMgmHandle h; + h= ndb_mgm_create_handle(); + ndb_mgm_set_connectstring(h, mgm); + ndb_mgm_connect(h,0,0,0); + int s= ndb_mgm_get_fd(h); + write(s,"get",3); + ndb_mgm_disconnect(h); + ndb_mgm_destroy_handle(&h); + /** NOTE: WE CANNOT REALLY TEST ANYTHING in 5.0 + * + * a more conservative patch for 5.0, full get and list + * sessions in 5.1. + * + * This is kept so that we can at least manually test easily + */ +} NDBT_TESTSUITE(testMgm); @@ -175,6 +197,11 @@ TESTCASE("SingleUserMode", INITIALIZER(runTestSingleUserMode); FINALIZER(runClearTable); } +TESTCASE("ApiSessionFailure", + "Test failures in MGMAPI session"){ + INITIALIZER(runTestApiSession); + +} NDBT_TESTSUITE_END(testMgm); int main(int argc, const char** argv){ |