diff options
author | unknown <joreland@mysql.com> | 2005-01-21 11:46:13 +0100 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-01-21 11:46:13 +0100 |
commit | 7510375ee454823c442e8dedc09dbcde69fb5aff (patch) | |
tree | 9d6460d1f9430c350ad9ab5f64ec7105026da90f /ndb | |
parent | 4be536c8c56317c850c97969dc43d370f80ad127 (diff) | |
parent | e5dc8298062e73de83d0c00baee9b3f4dedaf932 (diff) | |
download | mariadb-git-7510375ee454823c442e8dedc09dbcde69fb5aff.tar.gz |
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/home/jonas/src/mysql-5.0-ndb
ndb/src/mgmapi/mgmapi.cpp:
Auto merged
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/mgmapi/mgmapi.cpp | 5 | ||||
-rw-r--r-- | ndb/src/mgmclient/CommandInterpreter.cpp | 26 |
2 files changed, 24 insertions, 7 deletions
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 2872960f90a..f7585ec3ab5 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1158,7 +1158,7 @@ ndb_mgm_set_loglevel_node(NdbMgmHandle handle, int nodeId, int ndb_mgm_listen_event_internal(NdbMgmHandle handle, const int filter[], - int structured) + int parsable) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_listen_event"); const ParserRow<ParserDummy> stat_reply[] = { @@ -1181,7 +1181,8 @@ ndb_mgm_listen_event_internal(NdbMgmHandle handle, const int filter[], Properties args; - args.put("structured", structured); + if (parsable) + args.put("parsable", parsable); { BaseString tmp; for(int i = 0; filter[i] != 0; i += 2){ diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index bb48f08dda0..286264e070f 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -389,7 +389,7 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) } m_mgmsrv2 = ndb_mgm_create_handle(); if(m_mgmsrv2 == NULL) { - ndbout_c("Cannot create handle to management server."); + ndbout_c("Cannot create 2:nd handle to management server."); exit(-1); } if (ndb_mgm_set_connectstring(m_mgmsrv, _host)) @@ -459,6 +459,8 @@ event_thread_run(void* m) my_thread_init(); + DBUG_ENTER("event_thread_run"); + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; int fd = ndb_mgm_listen_event(handle, filter); if (fd > 0) @@ -486,17 +488,20 @@ event_thread_run(void* m) bool CommandInterpreter::connect() { + DBUG_ENTER("CommandInterpreter::connect"); if(!m_connected) { if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) { const char *host= ndb_mgm_get_connected_host(m_mgmsrv); unsigned port= ndb_mgm_get_connected_port(m_mgmsrv); - if(!ndb_mgm_set_connectstring(m_mgmsrv2, - BaseString(host).appfmt(":%d",port).c_str()) - && + BaseString constr; + constr.assfmt("%s:%d",host,port); + if(!ndb_mgm_set_connectstring(m_mgmsrv2, constr.c_str()) && !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { + DBUG_PRINT("info",("2:ndb connected to Management Server ok at: %s:%d", + host, port)); assert(m_event_thread == 0); assert(do_event_thread == 0); do_event_thread= 0; @@ -507,6 +512,7 @@ CommandInterpreter::connect() NDB_THREAD_PRIO_LOW); if (m_event_thread != 0) { + DBUG_PRINT("info",("Thread created ok, waiting for started...")); int iter= 1000; // try for 30 seconds while(do_event_thread == 0 && iter-- > 0) @@ -516,15 +522,25 @@ CommandInterpreter::connect() do_event_thread == 0 || do_event_thread == -1) { + DBUG_PRINT("warning",("thread not started")); printf("Warning, event thread startup failed, degraded printouts as result\n"); do_event_thread= 0; } } else { + DBUG_PRINT("warning", + ("Could not do 2:nd connect to mgmtserver for event listening")); + DBUG_PRINT("info", ("code: %d, msg: %s", + ndb_mgm_get_latest_error(m_mgmsrv2), + ndb_mgm_get_latest_error_msg(m_mgmsrv2))); printf("Warning, event connect failed, degraded printouts as result\n"); + printf("code: %d, msg: %s\n", + ndb_mgm_get_latest_error(m_mgmsrv2), + ndb_mgm_get_latest_error_msg(m_mgmsrv2)); } m_connected= true; + DBUG_PRINT("info",("Connected to Management Server at: %s:%d", host, port)); if (m_verbose) { printf("Connected to Management Server at: %s:%d\n", @@ -532,7 +548,7 @@ CommandInterpreter::connect() } } } - return m_connected; + DBUG_RETURN(m_connected); } bool |