Commit graph

8491 commits

Author SHA1 Message Date
Sergey Vojtovich
4472a0ef95 MDEV-7026 - Race in InnoDB/XtraDB mutex implementation can stall or hang the
server

This is an addition to original patch. Added full memory barrier to ensure
proper StoreLoad order between waiters and lock_word on PPC64.
2014-11-21 15:23:18 +04:00
Jan Lindström
b0febdb66e MDEV-7084: innodb index stats inadequate using constant innodb_stats_sample_pages
Use traditional statistics estimation by default (innodb-stats-traditional=true).
There could be performance regression for customers if there is a lot of
open table operations.
2014-11-21 13:27:36 +02:00
Jan Lindström
8bc5eabea8 MDEV-7084: innodb index stats inadequate using constant
innodb_stats_sample_pages

Analysis: If you set the number of analyzed pages 
to very low number compared to actual pages on 
that table/index it randomly pics those pages 
(default 8 pages), this leads to fact that query 
after analyze table returns different results. If 
the index tree is small, smaller than 10 * 
n_sample_pages + total_external_size, then the 
estimate is ok. For bigger index trees it is 
common that we do not see any borders between 
key values in the few pages we pick. But still 
there may be n_sample_pages different key values, 
or even more. And it just tries to 
approximate to n_sample_pages (8).

Fix: (1) Introduced new dynamic configuration variable
innodb_stats_sample_traditional  that retains
the current design. Default false.

(2) If traditional sample is not used we use
n_sample_pages = max(min(srv_stats_sample_pages,
                         index->stat_index_size),
                     log2(index->stat_index_size)*
                          srv_stats_sample_pages);

(3) Introduced new dynamic configuration variable
stat_modified_counter (default = 0) if set
sets lower bound for row updates when statistics is re-estimated.

If user has provided upper bound for how many rows needs to be updated
before we calculate new statistics we use minimum of provided value
and 1/16 of table every 16th round. If no upper bound is provided
(srv_stats_modified_counter = 0, default) then calculate new statistics
if 1 / 16 of table has been modified
since the last time a statistics batch was run.
We calculate statistics at most every 16th round, since we may have
a counter table which is very small and updated very often.
@param t table
@return true if the table has changed too much and stats need to be
recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
	((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
	ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
		16 + (t)->stat_n_rows / 16))
2014-11-19 20:27:34 +02:00
Kristian Nielsen
6ea41f1e84 MDEV-7026: Race in InnoDB/XtraDB mutex implementation can stall or hang the server.
The bug was that full memory barrier was missing in the code that ensures that
a waiter on an InnoDB mutex will not go to sleep unless it is guaranteed to be
woken up again by another thread currently holding the mutex. This made
possible a race where a thread could get stuck waiting for a mutex that is in
fact no longer locked. If that thread was also holding other critical locks,
this could stall the entire server. There is an error monitor thread than can
break the stall, it runs about once per second. But if the error monitor
thread itself got stuck or was not running, then the entire server could hang
infinitely.

This was introduced on i386/amd64 platforms in 5.5.40 and 10.0.13 by an
incorrect patch that tried to fix the similar problem for PowerPC.

This commit reverts the incorrect PowerPC patch, and instead implements a fix
for PowerPC that does not change i386/amd64 behaviour, making PowerPC work
similarly to i386/amd64.
2014-11-19 13:56:46 +01:00
Sergei Golubchik
302b50fa30 TokuDB 7.5.3 2014-11-18 17:54:00 +01:00
Rich Prohaska
50b928b046 DB-759 test and fix alter table bug with cardinality data 2014-11-13 10:53:22 -05:00
Rich Prohaska
2494bde757 DB-759 fix tokudb::alter_card to copy ALL of the cardinality data not just the low byte 2014-11-12 21:06:51 -05:00
Rich Prohaska
8a7f07711e increase test coverage of the cardinality code 2014-11-12 18:30:16 -05:00
Rich Prohaska
ca67239c51 speed up tokudb handler unit tests 2014-11-12 14:36:08 -05:00
Rich Prohaska
fa92c90393 speed up tokudb handler unit tests 2014-11-12 08:38:04 -05:00
Rich Prohaska
43c176a779 speed up tokudb handler unit tests 2014-11-10 16:34:55 -05:00
Elena Stepanova
b99328bbf8 Re-enabling tests disabled due to MDEV-5266 and MySQL:65225 (fixed now) 2014-11-17 20:28:18 +04:00
Jan Lindström
8c7ef99bb2 MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex
Analysis: InnoDB error monitor is responsible to call every second
sync_arr_wake_threads_if_sema_free() to wake up possible hanging 
threads if they are missed in mutex_signal_object. This is not 
possible if error monitor itself is on mutex/semaphore wait. We 
should avoid all unnecessary mutex/semaphore waits on error monitor.
Currently error monitor calls function buf_flush_stat_update() 
that calls log_get_lsn() function and there we will try to get 
log_sys mutex. Better, solution for error monitor is that in 
buf_flush_stat_update() we will try to get lsn with 
mutex_enter_nowait() and if we did not get mutex do not update 
the stats.

Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
function. If returned lsn is 0, we do not update flush stats. 
log_get_lsn_nowait() will use mutex_enter_nowait() and if
we get mutex we return a correct lsn if not we return 0.
2014-11-13 11:24:19 +02:00
Rich Prohaska
f127e2120c DB-757 compute cardinality when alter table analyze partition is run 2014-11-08 10:36:33 -05:00
Rich Prohaska
695ce3ad29 DB-756 set cardinality data for partitioned tokudb tables 2014-11-08 08:59:55 -05:00
Rich Prohaska
c14fdb70b1 DB-754 include my_config.h first for mariadb 5.5.40 2014-11-05 11:24:27 -05:00
Rich Prohaska
7adf64d857 DB-730 build tokudb without XA 2014-11-05 04:15:43 -05:00
Jan Lindström
2da6f7ceba MDEV-7017: Add function to print semaphore waits
Add function to print to stderr all current semaphore 
waits. This function should be able to executed 
inside a gdb/ddd.
2014-11-03 15:43:44 +02:00
Sergei Golubchik
50556e7e9a tokudb post-merge fixes 2014-11-02 17:33:02 +01:00
Sergei Golubchik
a2a18dd9d7 tokudb-7.5.3 2014-11-02 16:47:46 +01:00
Rich Prohaska
4c57196e02 DB-747 merge mariadb 10 frm hack and dont compile row format compression code 2014-10-25 16:16:23 -04:00
Rich Prohaska
57f2f606f0 DB-745 merge clustering key is covering key for mariadb 10 2014-10-24 12:34:55 -04:00
Rich Prohaska
ac995231d6 DB-746 merge clustering key is covering key for mariadb 10 2014-10-24 11:23:54 -04:00
Rich Prohaska
ad4af10218 DB-744 ER_GET_ERRNO has additional parameter on MariaDB 10 which crashes tokudb 2014-10-24 05:36:18 -04:00
Rich Prohaska
c5bf055079 DB-742 combine mysql and mariadb plugin declarations 2014-10-18 10:58:38 -04:00
Rich Prohaska
cfbe8342da DB-742 use consistent version macros 2014-10-17 21:23:17 -04:00
Rich Prohaska
5788312433 DB-742 set plugin version to tokudb_version_major.tokudb_version_minor 2014-10-17 13:46:15 -04:00
Kristian Nielsen
4c07b93bdb Fix missing UNIV_INTERN on dict_table_check_foreign_keys().
When UNIV_INTERN is missing in built-in XtraDB, this causes the
innodb_plugin to call the XtraDB version of the function instead
of its own (seen in --embedded-server test failure in Buildbot).
This in turn causes bad things to happen in case of difference
between XtranDB and innodb_plugin.
2014-10-20 10:50:10 +02:00
Rich Prohaska
178a511217 DB-742 set the tokudb plugin version string for mariadb 2014-10-16 19:50:53 -04:00
Rich Prohaska
de3cd3e182 DB-736 fix tokudb IS table errors 2014-10-08 08:39:40 -04:00
Sergei Golubchik
7e6d4bba0c XtraDB 5.5.40-36.1 2014-10-08 00:44:37 +02:00
Sergei Golubchik
e5bc21af37 MDEV-4813 Replication fails on updating a MEMORY table with an index using btree
skip NULL VARCHAR key parts like it's done elsewhere
2014-10-07 10:54:14 +02:00
Sergei Golubchik
0d2cba5df2 XtraDB 5.5.39-36.0 2014-10-06 20:06:39 +02:00
Sergei Golubchik
1ddfce4840 mysql-5.5.40 2014-10-06 19:53:55 +02:00
Rich Prohaska
69756a5994 DB-735 use thd_killed 2014-10-03 15:41:54 -04:00
Sergei Golubchik
384999f3e8 MDEV-6528 review debian patches for mysql
and apply whatever was reasonable
2014-10-02 11:58:24 +02:00
Sergei Golubchik
aa36d9e742 MDEV-5120 Test suite test maria-no-logging fails
stat structure (from <sys/stat.h>) is conditionally defined
to have different layout and size depending on the defined macros.
The correct macro is defined in my_config.h, which means it MUST be
included first (or, at least before <features.h> - so, practically,
before including any system headers).
2014-10-02 11:57:40 +02:00
Rich Prohaska
d24fd98e99 DB-732 map TOKUDB_OUT_OF_LOCKS tokudb error to HA_ERR_LOCK_TABLE_FULL handler error 2014-10-01 09:24:21 -04:00
Rich Prohaska
665a9b6ea7 DB-450 use interruptible cursors for index scans and info schema scans 2014-09-26 11:45:39 -04:00
Rich Prohaska
b3601d02f8 DB-397 remove table lock for tables with triggers in tokudb::start_stmt 2014-09-26 08:02:24 -04:00
Sergei Golubchik
02125587e1 update tokudb version in CMakeLists.txt, disable unstable tokudb tests 2014-09-25 19:00:41 +02:00
Sergei Golubchik
53a44915c5 merge 2014-09-23 23:37:35 +02:00
Sergei Golubchik
b91432b4a4 tokudb 7.5.0 2014-09-23 22:03:35 +02:00
Michael Widenius
348a24a70a Allow tokudb test to pass even if jemalloc is not available. 2014-09-23 13:57:55 +03:00
Rich Prohaska
b183d81d2e DB-714 read free replication 2014-09-15 07:47:43 -04:00
Sergei Golubchik
e3deed438a ft-index: restore a chunk that was lost in the merge
and other fixes for gcc-4.9.1 on sid
2014-09-13 21:32:49 +02:00
Sergei Golubchik
77a0c9b161 tokudb: use thd_killed() api function, not thd->killed directly 2014-09-13 08:32:53 +02:00
Sergei Golubchik
e7ddd89adc tokudb tests: master-slave.inc should be included *last* 2014-09-13 08:16:00 +02:00
Sergei Golubchik
aef3818981 tokudb 7.1.8 2014-09-13 00:28:15 +02:00
Sergei Golubchik
3d94523638 MDEV-6613 build system endianness test fails for ppc64le (i.e. Ubuntu)
* remove bundled jemalloc, use the system one
* force jemalloc in release builds on linux
2014-09-12 08:41:16 +02:00