Commit graph

170593 commits

Author SHA1 Message Date
Kristian Nielsen
51eaa7fe53 MDEV-8193: UNTIL clause in START SLAVE is sporadically disobeyed by parallel replication
The code was using the wrong variable when comparing the binlog name
for the UNTIL position. This could cause the comparison to fail after
binlog rotation, in turn causing the UNTIL clause to not trigger slave
stop.
2015-09-11 10:51:56 +02:00
Kristian Nielsen
09bfaf3a13 Fix a potential lost wakeup for binlog_commit_wait_usec
If a transaction T1 needs to wait for a transaction T2, T2's commit will
skip the normal binlog_commit_wait_usec delay, in order not to needlessly
stall throughput.

This works by checking if T2 is already ready to commit. If so, it is woken
up. If not, we set a flag in T2 so that when it gets ready to commit, it
will do so immediately.

But there was a potential race due to insufficient locking, if T2 gets ready
to commit just at the point where T1 does the check. If the race hits, the
wakeup (and early commit) of T2 might be lost.

The race is only theoretical (from code inspection, no known test case), but
seems best to fix it anyway, by properly locking LOCK_prepare_ordered around
the check.
2015-09-02 10:08:09 +02:00
Kristian Nielsen
999c43aeb7 MDEV-8725: Assertion `!(thd->rgi_slave && thd-> rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans
The assertion is there to catch cases where we rollback while
mark_start_commit() is active. This can allow following event groups
to be replicated too early, causing conflicts.

But in this case, we have an _explicit_ ROLLBACK event in the binlog,
which should not assert.

We fix this by delaying the mark_start_commit() in the explicit
ROLLBACK case. It seems safest to delay this in ROLLBACK case anyway,
and there should be no reason to try to optimise this corner case.
2015-09-02 09:57:18 +02:00
Kristian Nielsen
5ca061e65f Fix embedded server build 2015-08-04 15:35:04 +02:00
Kristian Nielsen
9b9c5e890c MDEV-8302: Duplicate key with parallel replication
This bug is essentially another variant of MDEV-7458.

If a transaction conflict caused a deadlock kill of T2 in record_gtid()
during commit, the code would do a rollback _before_ running
rgi->unmark_start_commit(). This creates a race where following transactions
could start too early (before T2 has completed its transaction retry). This
in turn could lead to replication failure, if there was a conflict that
caused eg. duplicate key error or similar.

The fix is to remove these rollbacks (in Query_log_event::do_apply_event()
and Xid_log_event::do_apply_event(). They seem out-of-place; code in
log_event.cc generally does not roll back on error, this is handled higher
up.

In addition, because of the extreme difficulty of reproducing bugs like
MDEV-7458 and MDEV-8302, this patch adds some extra precations to try to
detect (in debug builds) or prevent (in release builds) similar bugs.
ha_rollback_trans() will now call unmark_start_commit() if needed (and
assert in debug build when a caller does rollback without unmark first).

We also add an extra check for thd->killed() so that we avoid doing
mark_start_commit() if we already have a pending deadlock kill.

And we add a missing unmark_start_commit() call in the error case, found by
the above assertion.
2015-08-04 11:40:19 +02:00
Sergei Golubchik
a6087e7dc1 MDEV-5309 - RENAME TABLE does not check for existence of the table's engine
fix the test case for ps-protocol
2015-06-17 16:13:02 +02:00
Sergei Golubchik
5a4c5fa211 MDEV-5977 MariaDB 10.0 is not installable on Trusty when "trusty-updates universe" is in sources.list
fix upgrade[2] tests on trusty and utopic: add missing
conflicts/replaces, client-10.0 should conflict/replace client-5.5.

reformat other conflicts/replaces lines to make them easier
to read and merge
2015-06-17 14:18:16 +02:00
Sergei Golubchik
b56ad494b4 MDEV-8287 DROP TABLE suppresses all engine errors
in ha_delete_table()
* only convert ENOENT and HA_ERR_NO_SUCH_TABLE to warnings
* only return real error codes (that is, not ENOENT and
  not HA_ERR_NO_SUCH_TABLE)
* intercept HA_ERR_ROW_IS_REFERENCED to generate backward
  compatible ER_ROW_IS_REFERENCED

in mysql_rm_table_no_locks()
* no special code to handle HA_ERR_ROW_IS_REFERENCED
* no special code to handle ENOENT and HA_ERR_NO_SUCH_TABLE
* return multi-table error ER_BAD_TABLE_ERROR <table list> only
  when there were many errors, not when there were many
  tables to drop (but only one table generated an error)
2015-06-16 23:58:40 +02:00
Sergei Golubchik
66fd45afce MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4
in cmake tests let's treat clang like gcc (same options,
same builtins) in many cases.

* don't check the compiler when
  * testing for -fvisibility=hidden support
  * testing for HAVE_ABI_CXA_DEMANGLE
  * testing for HAVE_GCC_ATOMIC_BUILTINS
  * when removing options with string(replace)
  * when running ${CC} --version (ignore the error instead)
* run ABI checks for clang
* use "canonical" gcc flags for clang
* fix groonga too

Also:

* add cmake detection for gcc __atomic_* builtins. they might be
  supported (__ATOMIC_SEQ_CST is defined), but not for all operand
  sizes. In particular, 64-bit atomic load is problematic on i386
* cache check results for Windows
* remove the test for HAVE_CXXABI_H (HAVE_ABI_CXA_DEMANGLE is
  suffifient)
2015-06-16 23:58:21 +02:00
Sergei Golubchik
7bfda275a1 MDEV-8128 cmake fails to detect boost libraries 2015-06-16 23:58:14 +02:00
Sergei Golubchik
26b0cf4d3f MDEV-8183 Adding option mysqldump --no-data-med
* new mysqldump option
* add more engines to the "external data engines" list
* redo the check to be able to print the list of engines in --help
2015-06-16 23:58:05 +02:00
Sergei Golubchik
569d2f8154 Merge branch 'connect-10.0' into 10.0 2015-06-16 23:57:49 +02:00
Sergei Golubchik
985e430c0f after-merge fixes
in innobase: compilation error on windows
other changes: perfschema merge followup
2015-06-16 23:55:56 +02:00
Jan Lindström
27f0bd7d95 Fix test case innodb.xa_recovery crash on xtradb. 2015-06-16 17:33:21 +03:00
Jan Lindström
96806025eb Fix test failure on main.partition_innodb. 2015-06-16 16:20:55 +03:00
Jan Lindström
ababe047f8 Fix crash on test innodb.innodb-virtual-columns. We should create
only columns really stored to database.
2015-06-16 15:16:53 +03:00
Jan Lindström
b83855a1c7 Fix innochecksum build failure. 2015-06-16 14:55:21 +03:00
Sergei Golubchik
5355972b71 after merge fixes: InnoDB and XtraDB 2015-06-16 12:49:00 +02:00
Sergei Golubchik
ede08808e9 Merge branch 'merge-perfschema-5.6' into 10.0 2015-06-16 12:47:58 +02:00
Sergei Golubchik
9859d366b5 Merge branch 'merge-xtradb-5.6' into 10.0 2015-06-16 12:46:14 +02:00
Sergei Golubchik
a65162a396 Merge branch 'merge-innodb-5.6' into 10.0 2015-06-16 11:08:23 +02:00
Sergei Golubchik
90849456d7 5.6.24-72.2 2015-06-16 11:04:40 +02:00
Sergei Golubchik
3c3724991e 5.6.25 2015-06-16 11:00:33 +02:00
Sergei Golubchik
139ba26dba 5.6.25 2015-06-16 10:57:05 +02:00
Sergey Vojtovich
909f760701 MDEV-5309 - RENAME TABLE does not check for existence of the table's engine
When RENAME TABLE is executed, it apparently does not check whether the engine
is available (unlike ALTER TABLE .. RENAME, which does). It means that if the
engine in question was not loaded on some reason, the table might become
unusable, since the engine won't know about the change.

With this patch RENAME TABLE fails if storage engine is not available.
2015-06-16 12:12:17 +04:00
Sergei Golubchik
b988553c52 MDEV-7771 missing client plugins when mariadb-shared is not installed
Put client plugins into -common rpm, not -shared.
Because they're needed for
* all clients that link with shared libmysqlclient (-shared)
* our clients from -client rpm, they're statically linked (-client)
* the server that acts as a replication slave (-server)
2015-06-15 20:28:13 +02:00
Alexey Botchkov
02421aa284 MDEV-7871 Tests fail massively on "Assertion `status_var.memory_used == 0'" when run with --ps --embedded.
As the MF_THREAD_SPECIFIC was introduced to the alloc_root's and
   the prealloc added to the statement::mem_root and statement::result.alloc, we have to adjust
   the embedded server to it. The preallocation was removed for the embedded server as it
   makes no sence for it. The msyqltest should free the statement inside the proper thead to
   make the memory statistics happy.
2015-06-15 18:07:41 +05:00
Sergei Golubchik
a117030377 MDEV-8131 MariaDB does not build on hurd-i386: plugin/auth_dialog/dialog.c:172:20: error: 'RTLD_DEFAULT' undeclared
define _GNU_SORUCE before including dlfcn.h
2015-06-15 11:07:59 +02:00
Sergei Golubchik
3288f2667a include the correct IPv6 check in perfschema tests 2015-06-15 11:07:59 +02:00
Sergei Golubchik
2a0f086728 don't scream when auto-selected IPv6 is not available
when --bind-address is not specificed explicitly (or set to '*')
MariaDB tries all wildcard addresses. Print a warning (not an error)
if a socket cannot be created for some of them.

Still print an error if a socket cannot be created for an address
that a user has specified expicitly with --bind-address.
2015-06-15 11:07:58 +02:00
Sergei Golubchik
a453a28040 MDEV-8083 MTR is broken on systems with IPv6 disabled
disable IPv6 globally in mysql-test, only use it
in dedicated IPv6 tests (where it is enabled per-test)
2015-06-15 11:07:58 +02:00
Alexander Barkov
aad8667f8a Committing a change into r/type_time_hires.result forgotten
in the previous commit for MDEV-8205.
2015-06-15 11:11:42 +04:00
Alexander Barkov
43e4522672 MDEV-8205 timediff returns null when comparing decimal time to time string value 2015-06-15 11:04:06 +04:00
Kristian Nielsen
f69f3db7f3 Merge branch 'mdev8294' into 10.0 2015-06-15 08:25:09 +02:00
Kristian Nielsen
4c251af97b MDEV-8316: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "any_slave_sql_running"
Fix a handful of "return" that should be DBUG_RETURN in sql/rpl_mi.cc.
2015-06-15 08:23:26 +02:00
Kristian Nielsen
93c039dd3c MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
Follow-up patch to temporarily avoid a sporadic failure in the test
rpl.rpl_000011 due to MDEV-8301.

There is a window during thread exit where the global status is
counted incorrectly - the contribution for the exiting thread is
counted twice. The patch for MDEV-8294 made this window visible to the
test case rpl.rpl_000011, causing it to sporadically fail. Temporarily
silence this with a wait for the expected value; can be removed once
MDEV-8294 is fixed.
2015-06-15 08:13:40 +02:00
Alexey Botchkov
196528eb42 MDEV-8212 alter table - failing to ADD PRIMARY KEY IF NOT EXISTS when existing index of same as column name.
The default name for the primary key is rather 'PRIMARY' instead of the indexed column name.
2015-06-14 18:54:13 +05:00
Jan Lindström
fc31e3114b MDEV-8179: Absent progress report for operations on InnoDB tables
Add progress info on InnoDB/XtraDB row0merge phase. Note that we
do not know exact number of rounds merge sort needs at start thus
also progress report might not be accurate.
2015-06-14 17:32:21 +03:00
Sergei Golubchik
36bf482db1 MDEV-8285 compile fails under Mac OS X 10.6.8 due to use of strnlen
#include <m_string.h> where strnlen() is used
2015-06-14 15:51:34 +02:00
Jan Lindström
e2879ac526 MDEV-7881: InnoDB Logfile size - misleading error message
Added test case to show that correct error message is printed when
log file size is too small for big blob.
2015-06-14 08:14:28 +03:00
Sergei Golubchik
e85b6615d8 Merge branch 'bb-10.0-serg' into 10.0 2015-06-12 08:00:48 +02:00
Alexander Barkov
d437c35d97 Adding a few warning related protected methods in Field and reducing
some duplicate code.
2015-06-11 22:54:03 +04:00
Sergei Golubchik
b9eb7f12db CRLF 2015-06-11 20:20:52 +02:00
Sergei Golubchik
6d49d3b2cc compiler warnings 2015-06-11 20:20:45 +02:00
Sergei Golubchik
810cf362ea Merge branch '5.5' into 10.0 2015-06-11 20:20:35 +02:00
Sergei Golubchik
d199a0ffb0 more renames after tokudb merge 2015-06-11 17:47:52 +02:00
Sergei Golubchik
b96c196f1c Item_cache::safe_charset_converter() fixes
* take into account that example may be NULL
* use example->safe_charset_converter(), copy-paste from
  Item::safe_charset_converter() (example might have its own
  implementation)
* handle the case when the charset doesn't need conversion
  (and return this).
2015-06-11 16:48:10 +02:00
Sergei Golubchik
7c98e8a31b fix after the tokudb ft-index merge 2015-06-11 16:43:56 +02:00
Kristian Nielsen
36f37a4890 Merge MDEV-8294 into 10.0 2015-06-10 12:01:06 +02:00
Kristian Nielsen
682ed005c5 MDEV-8294: Inconsistent behavior of slave parallel threads at runtime
There were some cases where the slave SQL thread could stop without
the pool of parallel replication worker threads being correctly
de-activated.
2015-06-10 11:57:42 +02:00