Commit Graph

137 Commits

Author SHA1 Message Date
f30a30c875 Fix #287: Issue of MYSQL_OPT_SSL_MODE
In drv_mysql.c do not assume MYSQL_OPT_SSL_MODE to be a preprocessor
define. It is an mysql_option enum value with all MySQL
versions. Instead, do a configure-time check if that value is defined in
mysql.h.
2019-01-16 14:57:37 +03:00
54da9152c8 --rate mode: remove the now unnecessary queue_is_full global variable. 2018-12-24 08:40:23 +03:00
a4b8aeb31a regression tests: remove unnecessary error leading to opt_rate.t instability. 2018-12-23 11:12:00 +03:00
8744b88cad Return a non-zero exit code on event queue overflow in the --rate mode. 2018-12-22 20:11:34 +03:00
3b7aacb567 --rate mode: fix a bogus error about eventgen thread termination
When the --rate option was used together with the --time option, a bogus
"Terminating the event generator thread failed" error was thrown at the
end of the test.
2018-12-17 21:59:09 +03:00
b017a998ef Fix GH-282: Mysql's fetch_row() is broken
Fix both MySQL and PostgreSQL drivers to return an error when
fetch_row() is called after retrieving all rows in the result set.
2018-12-16 17:21:39 +03:00
bb8c3b04c5 --rate mode: fix latency stats skew on low rates
Worker threads used sleep() in the bounded rate mode to avoid CPU
hogging when polling on the event queue. The problem was that sleep()
calls increased time spent by events in the queue, which is counted
towards event latency to avoid the coordinated omission problem. The
lower the rate, the bigger impact on latency was observed.

The fix is replacing sleep()s with a condition variable which is now
used to put worker into an idle wait when the queue is empty. The event
generation thread now uses pthread_cond_signal() after each generated
event to wake up an idle worker thread. Which somewhat increases
sysbench CPU consumption, especially for high rates.
2018-12-10 21:05:38 +03:00
49f17576f2 Add /usr/share/lua/5.1 to LUA_PATH and /usr/lib/lua/5.1 to LUA_CPATH.
Those are the paths used by Luarocks on CentOS by default.
2018-10-23 14:56:40 +03:00
aa52c53001 Update copyright year in sysbench.cmdline.lua. 2018-05-11 22:24:41 +03:00
d805300846 Fix GH-223: test failure on ppc64
Make sysbench.cmdline.print_test_options() output deterministic by
sorting option names when parsing.
2018-05-11 22:22:33 +03:00
e633f9c744 Fix GH-229: "--file-fsync-freq=0" seems to prevent fsync() at end of test
Ensure fsync() is called at the end of a fileio benchmark regardless of
--events, --time and --file-fsync-freq values.
2018-05-03 18:41:24 +03:00
061ba339fc Update copyright year in sb_options.c. 2018-04-16 13:22:46 +03:00
af11fa7bd4 Improve parsing of boolean command line options.
Accept true/1 as synonyms for 'on', and 'false'/0 as synonyms for
'off'. Also reject other values instead of silently converting them to
'off'.
2018-04-12 22:11:16 +03:00
92b1426276 Use --db-driver=mysql by default, if the MySQL driver is available.
If the MySQL driver is available and --db-driver option was explicitly
specified, assume MySQL and don't compain about multiple DB drivers
being available.

That was a popular request and is likely what most sysbench users want.
2018-04-02 11:20:55 +03:00
56b473faf6 Fix GH-195: Fix JSON reporter to produce valid JSON
sysbench.report_json() now generates well-formed JSON without comma
after the last array element and with proper opening/closing brackets.
2018-04-01 13:59:00 +03:00
b3169380ad Fix Lua state usage after closing it in sb_lua_close_state(). 2018-04-01 08:29:11 +03:00
a4cb8a6c6d Fix a help message typo. 2018-03-28 13:09:24 +03:00
7b451463c1 Fix a comment typo. 2018-03-28 13:03:07 +03:00
7b383cc537 Don't fail when query_row() is called with an empty SELECT. 2018-03-23 19:13:52 +03:00
89e37ba6f7 Don't crash when SQL bulk insert API calls are used out of order. 2018-03-21 22:43:08 +03:00
7263769245 tests: add --validate test to test_fileio.t 2018-02-17 19:42:22 +03:00
976208719b OLTP tests: re-prepare statements after reconnects (fixes #213).
Fix oltp_common.lua to re-prepare prepared statements after
reconnecting, i.e. if a connection to the server has been lost and one
of the following MySQL errors is in the --mysql-ignore-errors list:

- 2013 (CR_SERVER_LOST)
- 2055 (CR_SERVER_LOST_EXTENDED)
- 2006 (CR_SERVER_GONE_ERROR)
- 2011 (CR_TCP_CONNECTION)
2018-02-17 17:55:43 +03:00
4ed79a7465 Update copyright dates. 2018-02-17 15:49:30 +03:00
d000761b9c --file-extra-flags now accepts a list of flags rather than a single value 2018-02-03 19:19:12 +03:00
ddaa13c45b Improve report formatting for long latency values. 2018-01-20 23:55:37 +03:00
a60b0ea2a7 Minor code cleanups around timer and usleep() calls. 2018-01-17 00:07:36 +03:00
4bdb68a15a Improve --rate mode precision for high argument values. 2018-01-16 21:31:07 +03:00
b7ab36dd3d Update copyrights. 2018-01-06 12:32:12 +03:00
7ee5776eff Remove build dependency on xxd/vim-common. 2018-01-06 11:11:53 +03:00
09db2db521 Update copyright in sysbench.lua. 2018-01-02 21:48:55 +05:00
b7dd7e0781 fix the ret value by which we can stop benchmark in event 2018-01-02 20:08:36 +05:00
2cdb3adaa8 Fix sb_counters declaration. 2017-12-24 16:22:14 +03:00
6e979f5aef GH-198: Tolerate misaligned test_files.
Adjust I/O request size if it crosses file size boundaries. Which may
happen if the specified file size is not a multiple of block size.
2017-12-23 14:07:29 +03:00
f9d79aefe5 Addendum to patch for GH-196: skip file size validation on seqwr tests. 2017-12-23 13:26:53 +03:00
b9c6b3a2df Fix GH-196: fileio: validate file sizes on startup
In the fileio test, throw a descriptive error on startup if a test file
size is lower than expected.
2017-12-17 13:07:20 +03:00
0a9acfe2a2 Fix compiler warnings introduced by commit 5a9d681.
Revert counter API functions to use 'static inline' again, but make them
available from Lua by 'instantiating' in sb_lua.c.
2017-12-02 21:32:33 +03:00
d748388fc7 Update comments for counter API functions. 2017-12-02 15:20:56 +03:00
5a9d6811df Use C99 inlines for sb_counter API to make them LuaJIT/FFI usable. 2017-12-01 11:09:58 +03:00
e6f34657d2 Print a header before options lists on missing --file-test-mode.
When the required --file-test-mode option is missing, print a header
before printing the list of available options.
2017-12-01 10:45:52 +03:00
0169d42681 Fix #180: Add support for CockroachDB (PostgreSQL protocol)
Add '40001' (serialization_failure) to the list of ignored SQL states in
drv_pgsql.c. The error appears to be specific to CockroachDB, but
restarting the current transaction is the only reasonable way to handle
it.
2017-11-14 11:30:12 +03:00
06c7f55f24 Fix #178: (--tables>1 --threads>1 broken in oltp_insert.lua)
A combination of --tables and --threads with non-default (i.e. higher
than 1) values resulted in incompleted set of tables generated by
"prepare" for the oltp_insert.lua script.
2017-11-09 12:35:17 +03:00
41de580cf9 Fix an incorrect flag check. 2017-11-09 10:16:30 +03:00
4bbccaac3c Add /usr/local/lib/lua/5.1 to default LUA_CPATH.
It is the default cpath used by LuaRocks.
2017-10-25 14:51:59 +03:00
1d37b3a8b3 Add /usr/local/share/lua/5.1 to default LUA_PATH.
The path is the default LuaRocks global install root, so it is a
frequent request to have it in the default LUA_PATH in sysbench.
2017-10-25 14:35:53 +03:00
f5fa7800cb A better version of the fix for #172. 2017-09-17 23:32:38 +03:00
cd13882cb6 Fix #172: sysbench 1.0.9 doesn't build with mariadb 10.2.8
Add a configure check for <server/mysql_version.h> which appears to be
the most portable way to fix MariaDB builds (see MDEV-13773).
2017-09-17 22:23:30 +03:00
a880fc4bcc Make sysbench.opt available to init()/done() by exporting it to global Lua state. 2017-09-15 20:43:28 +03:00
cd2b738022 Avoid PK conflicts in oltp_insert.lua by creating empty tables on 'prepare'. 2017-09-12 10:08:59 +03:00
305be15ebc Fix #168: oltp_delete.lua uses DELETE + INSERT statements
Remove INSERT statements from oltp_delete.lua.
2017-08-23 16:14:14 +03:00
9ca119c9c7 Add workaround for MySQL #87337 to build against 8.0.2. 2017-08-21 19:24:13 +03:00