Commit graph

1245 commits

Author SHA1 Message Date
stewart@mysql.com[stewart]
e8121e50e8 [PATCH] WL#3704 mgmapi timeouts: Return sane errors for timeout in mgmapi
In ndb_mgm_call, add checks for expired timeout in (Input|Output)Stream.
In case of timeout, we set NdbMgmHandle->last_error and return NULL.

In api calls not using ndb_mgm_call (or using it in conjunction with
own IO), they'll need to check for timeouts manually. Macros are provided
to do this.

Add ndb_mgm_disconnect_quiet(h) to disconnect without checking errors
(so we don't clobber NdbMgmHandle->last_error). This helps us provide
the *consistent* semantic that on timeout we leave the NdbMgmHandle
*disconnected*. We check for this in testMgm.

Change CHECK_REPLY in mgmapi to also check for set error in handle->last_error
This will pick up the ETIMEDOUT errors and return them to client (through
returning correct failure code for API call and setting NdbMgmHandle error).
Applications written to MGMAPI before this patch will behave as before,
and even hopefully check get_last_error and report the error back to the
end user!

Adding the last CHECK_TIMEDOUT_RET and delete in ndb_mgm_call() we
slightly change behaviour of mgmapi. Previously, if disconnect
midway through a reply, where there were only optional parameters left,
we'd get a Properties object from ndb_mgm_call() containing NULLs for
the optional parameters, leading to interesting error messages. This
enables the returning of the *real* message and actually improves the API
without breaking compatibility.

ndb_mgm_start_signallog
ndb_mgm_stop_signallog
ndb_mgm_log_signals
ndb_mgm_set_trace
ndb_mgm_insert_error
ndb_mgm_set_int64_parameter [1]
ndb_mgm_set_string_parameter [1]
ndb_mgm_purge_stale_sessions [2]
 - return error code on error during ndb_mgm_call

TODO:
ndb_mgm_report_event [2]

[1] marked for removal, unused.
[2] return codes incorrect in CHECK_HANDLE/CONNECTED. undocumented.


Server side:
 in Services (per session) add macro for injecting timeout error
 (just waiting 10 seconds before continuing... it does work!)

 We inject these errors in a number of critical places - including
 the tricky api functions that don't just use ndb_mgm_call but do
 their own thing (get_config, get_status and friends)

ATRT:
 Expand testMgm to add timout tests for API. Fully automated.
 *THEORETICALLY* timing dependent - an ultra-slow network will
 cause problems and "fake" failures... I welcome other solutions.

 Tests aren't exhaustive, but cover the generics and the tricky bits.
 Also test some calling semantics (incl disconnected on error).

 It is encouraged to add *more* mgmapi tests, not less :)

InputStream:
  Fix where timedout error is set


Index: ndb-work/storage/ndb/src/mgmapi/mgmapi.cpp
===================================================================
2007-03-22 22:33:56 +11:00
stewart@mysql.com[stewart]
64361ee36f [PATCH] WL#3704 mgmapi timeouts: Add bool timeout flag to Streams
Index: ndb-work/storage/ndb/include/util/InputStream.hpp
===================================================================
2007-03-22 22:33:43 +11:00
stewart@mysql.com[stewart]
c2f0a25dc4 [PATCH] WL#3704 mgmapi timeouts: Rename inputstream timeout
Index: ndb-work/storage/ndb/include/util/InputStream.hpp
===================================================================
2007-03-22 22:33:31 +11:00
stewart@mysql.com[stewart]
36888199ac [PATCH] WL#3704 mgmapi timeouts: add ndb_mgm_set_timeout(h,ms)
Add not so neat set_timeout call to make testMgm work

Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h
===================================================================
2007-03-22 22:33:19 +11:00
stewart@mysql.com[stewart]
395a24409d [PATCH] WL#3704 mgmapi timeouts: Add ndb_mgmd error injection
Add error injection either for this connection or for whole server.

Currently nothing for injecting errors into *another* connection... but that's
perhaps getting tricky-dicky for this point in time. Perhaps needed for events
if we don't do anything fancy.

Index: ndb-work/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
===================================================================
2007-03-22 22:33:07 +11:00
stewart@mysql.com[stewart]
272779e71e [PATCH] WL#3704 mgmapi timeouts: use NdbMgmHandle write_timeout
Start using the write_timeout we already have in NdbMgmHandle

Index: ndb-work/storage/ndb/src/mgmapi/mgmapi.cpp
===================================================================
2007-03-22 22:32:54 +11:00
jonas@perch.ndb.mysql.com
05a8790f0b Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-22 11:23:47 +01:00
jonas@perch.ndb.mysql.com
4a1c8d296b Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-22 11:21:26 +01:00
jonas@perch.ndb.mysql.com
155e3d1139 ndb -
fix testprg
2007-03-22 11:20:38 +01:00
jonas@perch.ndb.mysql.com
0e1974d2bf ndb - fix test prg 2007-03-22 11:17:57 +01:00
tomas@whalegate.ndb.mysql.com
753bc96eca Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-03-22 10:33:26 +01:00
tomas@whalegate.ndb.mysql.com
6e7528bd34 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-03-22 05:45:17 +01:00
tsmith@quadxeon.mysql.com
54e7bc8daa Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/51
2007-03-22 01:04:39 +01:00
jonas@perch.ndb.mysql.com
ca00e63853 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-21 15:37:14 +01:00
jonas@perch.ndb.mysql.com
2cd7ff4e8a Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-21 15:36:23 +01:00
jonas@perch.ndb.mysql.com
8a149f2638 Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
2007-03-21 15:35:22 +01:00
tomas@whalegate.ndb.mysql.com
d2f8bd9ae7 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-03-21 09:28:22 +01:00
jonas@perch.ndb.mysql.com
62fde95e08 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-21 09:07:55 +01:00
jonas@perch.ndb.mysql.com
762ddadc24 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-21 09:06:44 +01:00
jonas@perch.ndb.mysql.com
ec97b008f0 ndb - bug#27286
make sure master node is sendable, when getting ref::NotMaster
2007-03-21 08:47:54 +01:00
tomas@whalegate.ndb.mysql.com
38ac10df54 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco-gca
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-03-21 08:23:15 +01:00
tomas@whalegate.ndb.mysql.com
3ab996f18f correct event buffer status reporting 2007-03-21 08:22:36 +01:00
tsmith@quadxeon.mysql.com
7018d9c5aa Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/mar20/maint/51
2007-03-20 21:12:46 +01:00
kent@kent-amd64.(none)
a149769b2d Merge mysql.com:/home/kent/bk/tmp/mysql-5.0-build
into  mysql.com:/home/kent/bk/tmp/mysql-5.1-build
2007-03-20 17:58:30 +01:00
tomas@whalegate.ndb.mysql.com
3f16977b32 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
2007-03-20 17:08:23 +01:00
tomas@whalegate.ndb.mysql.com
7bd5241cb4 enabled test case
+ some fixes to do the enable
2007-03-20 17:07:53 +01:00
jonas@perch.ndb.mysql.com
8c3751209c Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-20 16:36:31 +01:00
jonas@perch.ndb.mysql.com
42b3e0a5af Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
2007-03-20 16:32:11 +01:00
tomas@whalegate.ndb.mysql.com
64b9bda21f BUG#24363 If the table structure has been changed, the default action about the restore will fail.
- correction of patch, original patch will segfault for print option
2007-03-20 11:11:08 +01:00
kostja@bodhi.local
bdb10baec1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-03-20 00:42:11 +03:00
jonas@perch.ndb.mysql.com
229ee6d4f1 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-19 14:55:13 +01:00
jonas@perch.ndb.mysql.com
886e11736b ndb - test_event
Fix compile error with gcc4
2007-03-19 14:51:17 +01:00
jonas@perch.ndb.mysql.com
6856693904 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-19 12:39:03 +01:00
jonas@perch.ndb.mysql.com
09e403aa9e ndb - bug#20185
Fix race in testprg...causing random TC crashes
2007-03-19 12:31:23 +01:00
jonas@perch.ndb.mysql.com
582312fd34 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-19 11:15:05 +01:00
jonas@perch.ndb.mysql.com
bdb70f7b43 ndb - autotest
increase some timeouts...
2007-03-19 11:13:10 +01:00
jonas@perch.ndb.mysql.com
40c3797ef0 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-16 11:13:01 +01:00
jonas@perch.ndb.mysql.com
a8a220534c Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-16 11:12:15 +01:00
jonas@perch.ndb.mysql.com
f161857d3e ndb - bug#27203
Allow readTablePk to stumble on scan+deleted tuple,
      reporting no-match instead of crash (in case scan is lock-owner)
2007-03-16 10:58:24 +01:00
kostja@bodhi.local
7d84ef0e11 Bug#26765 "typo when running mysql-test-run"
Fix a typo (togheter -> together)
2007-03-15 23:17:44 +03:00
hartmut@hartmut-desktop.buero.foebud.org
d2986bff2e Merge hholzgraefe@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into  mysql.com:/home/hartmut/projects/mysql/dev/bug-trees/mysql-5.1-bug25933
2007-03-15 13:52:25 +01:00
jonas@perch.ndb.mysql.com
85220e3940 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-15 13:37:04 +01:00
hartmut@mysql.com/hartmut-desktop.buero.foebud.org
4c9f4a006f added missing prototype implementations (bug #25933) 2007-03-15 13:35:49 +01:00
jonas@perch.ndb.mysql.com
1bf8202fce ndb - bug#27169
Fix bug in SUMA::resend_bucket which could cause mysqld to crash
2007-03-15 13:30:42 +01:00
jonas@perch.ndb.mysql.com
f8483eccc3 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-15 11:06:57 +01:00
jonas@perch.ndb.mysql.com
1c203fcc04 Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into  perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
2007-03-15 11:06:01 +01:00
jonas@perch.ndb.mysql.com
14de245543 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-15 07:16:44 +01:00
jonas@perch.ndb.mysql.com
1fa2a64778 ndb -
fix test_event -n EventOperationApplier
2007-03-15 07:08:15 +01:00
jonas@perch.ndb.mysql.com
a7714519a7 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-14 15:41:24 +01:00
jonas@perch.ndb.mysql.com
72bd367013 Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
2007-03-14 15:40:06 +01:00