Commit graph

2994 commits

Author SHA1 Message Date
Sergei Golubchik
5091a4ba75 Merge tag 'mariadb-10.0.19' into 10.1 2015-06-01 15:51:25 +02:00
Kristian Nielsen
903f8dc72d Merge MDEV-8147 into 10.1 2015-05-26 15:03:22 +02:00
Kristian Nielsen
e5f1e841dc MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication
When the slave processes the master restart format_description event,
parallel replication needs to complete any prior events before processing
the restart event (which closes temporary tables and such stuff).

This happens in wait_for_workers_idle(), however it was not waiting long
enough. The wait was using wait_for_prior_commit(), but at that points table
can still be open. This lead to assertion in this case.

So change wait_for_workers_idle() to wait until all worker threads have
reached finish_event_group(), at which point all tables should have been
closed.
2015-05-26 13:04:15 +02:00
Sergey Vojtovich
18f88d6d94 MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Avoid calling current_thd from thd_kill_level(). This reduces number of
pthread_getspecific() calls from 776 to 354.

Also thd_kill_level(NULL) is not permitted anymore: this saves one condition.
2015-05-14 12:50:23 +04:00
Sergey Vojtovich
b22959903b MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP RO
Added THD argument to select_result and all derivative classes.
This reduces number of pthread_getspecific calls from 796 to 776 per OLTP RO
transaction.
2015-05-13 15:56:56 +04:00
Sergey Vojtovich
55d5af733d MDEV-7945 - THD::enter_stage() takes 0.48% in OLTP RO
THD::enter_stage() optimizations:
- stage backup code moved to THD::backup_stage(), saves one condition
- moved check for "new_stage" out to callers that actually need it
- remnants of enter_stage() moved to sql_class.h so it can be inlined

THD::enter_stage() overhead dropped 0.48% -> 0.07%.

PROFILING::status_change() optimizations:
- "status_arg" is now checked by QUERY_PROFILE::new_status()
- no need to check "enabled": !enabled && current is impossible
- remnants of status_change() moved to sql_profile.h so it can be inlined

PROFILING::status_change() overhead dropped 0.1% -> out of radar.
2015-05-13 10:43:13 +04:00
Sergey Vojtovich
7ed673f35c MDEV-7793 - Race condition between XA COMMIT/ROLLBACK and disconnect
XA COMMIT/ROLLBACK of XA transaction owned by different thread may access
freed memory if that thread disconnects at the same time.

Also concurrent XA COMMIT/ROLLBACK of recovered XA transaction were not
serialized properly.
2015-05-07 16:48:30 +04:00
Sergei Golubchik
1d3ea9ecd8 perfschema 5.6.24
including the big commit
  commit 305130361bf72726de220f3d2b2787395e10be61
  Author: Marc Alff <marc.alff@oracle.com>
  Date:   Tue Feb 10 11:31:32 2015 +0100

      WL#8354 BACKPORT DIGEST IMPROVEMENTS TO MYSQL 5.6

(with the following commits) and related changes in sql/
2015-05-05 15:23:47 +02:00
Sergei Golubchik
49c853fb94 Merge branch '5.5' into 10.0 2015-05-04 22:00:24 +02:00
Sergei Golubchik
0f12ada6b6 Merge remote-tracking branch 'mysql/5.5' into 5.5 2015-04-27 21:04:06 +02:00
Sergei Golubchik
e26b2071be MDEV-7938 MariaDB Crashes Suddenly while writing binlogs
on disconnect THD must clean user_var_events array before
dropping temporary tables. Otherwise when binlogging a DROP,
it'll access user_var_events, but they were allocated
in the already freed memroot.
2015-04-27 15:42:12 +02:00
Kristian Nielsen
791b0ab5db Merge 10.0 -> 10.1 2015-04-20 13:21:58 +02:00
Oleksandr Byelkin
01d7da6785 MDEV-7834: ANALYZE FORMAT=JSON output column should be named ANALYZE 2015-03-25 19:55:11 +01:00
Alexander Barkov
0c26c0032c A preparatory patch for MDEV-7284 INDEX: CREATE OR REPLACE.
Removing "bool Key::create_if_not_exists" and deriving Key from
DDL_options instead.
2015-03-20 13:51:41 +04:00
Sergey Vojtovich
fec94a6b44 MDEV-7728 - Improve xid cache scalability by using lock-free hash
This is an addition to original patch. Some platforms are strict about atomic
op argument signedness.
2015-03-16 22:54:43 +04:00
Alexander Barkov
e6f67c64cd MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database 2015-03-16 21:55:10 +04:00
Sergey Vojtovich
6bd24deab4 MDEV-7728 - Improve xid cache scalability by using lock-free hash
XID cache is now based on lock-free hash.
Also fixed lf_hash_destroy() to call alloc destructor.

Note that previous implementation had race condition when thread was accessing
XA owned by different thread. This new implementation doesn't fix it either.
2015-03-16 19:07:51 +04:00
Kristian Nielsen
184f718fef MDEV-7249: Performance problem in parallel replication with multi-level slaves
Parallel replication (in 10.0 / "conservative" mode) relies on binlog group
commits to group transactions that can be safely run in parallel on the
slave. The --binlog-commit-wait-count and --binlog-commit-wait-usec options
exist to increase the number of commits per group. But in case of conflicts
between transactions, this can cause unnecessary delay and reduced througput,
especially on a slave where commit order is fixed.

This patch adds a heuristics to reduce this problem. When transaction T1 goes
to commit, it will first wait for N transactions to queue up for a group
commit. However, if we detect that another transaction T2 is waiting for a row
lock held by T1, then we will skip the wait and let T1 commit immediately,
releasing locks and let T2 continue.

On a slave, this avoids the unfortunate situation where T1 is waiting for T2
to join the group commit, but T2 is waiting for T1 to release locks, causing
no work to be done for the duration of the --binlog-commit-wait-usec timeout.

(The heuristic seems reasonable on the master as well, so it is enabled for
all transactions, not just replication transactions).
2015-03-13 14:01:52 +01:00
Oleksandr Byelkin
a71e2d23bd MDEV-7006 MDEV-7007: SET STATEMENT and slow log
fixed embedded server tests
MDEV-7009: SET STATEMENT min_examined_row_limit has no effect
MDEV-6948:SET STATEMENT gtid_domain_id = ... FOR has no effect (same for gtid_seq_no and server_id)

old values of SET STATENENT variables now saved in its own Query_arena and restored later
2015-03-12 10:19:32 +01:00
Sergei Petrunia
66ad265f3b MDEV-7674: ANALYZE shows r_rows=0
Change r_rows to be double
2015-03-07 19:30:19 +03:00
Alexander Barkov
72d7b12b9c Reducing duplicate code and simplifying well formed string copying
by adding a new class String_copier.

This is a pre-requisite patch for MDEV-6566 and MDEV-6572,
to avoid adding more similar code.
2015-02-27 16:26:12 +04:00
Vicențiu Ciorbaru
77806da0da Fix incorrect parameter passing to create_tmp_table in create_result_table
Create_tmp_table was called incorrectly called in
select_materialized_with_stats::create_result_table, having keep_row_order
passed for the do_not_open parameter and keep_row_order always set to false.
2015-02-26 23:31:35 +02:00
Sergei Golubchik
8e7649867f Merge 10.0-galera into 10.1 2015-02-06 16:14:23 +01:00
Sergei Golubchik
f9448bcb21 small cleanups 2015-02-05 19:18:39 +01:00
Sergei Golubchik
bfe703a458 don't let current_thd to point to a destroyed THD
* reset current_thd in THD::~THD, otherwise my_malloc_size_cb_func()
  might access THD after it was destroyed.
* remove now redundant set_current_thd(0) calls that follow delete thd.
2015-02-03 18:19:56 +01:00
Monty
0ee879ff8a Improve performance for calculating memory allocation
Extend interface for 'show variables' with current scope
2015-02-01 15:24:22 +02:00
Nisha Gopalakrishnan
aa1de73728 Bug#20094067: BACKPORT BUG#19683834 TO 5.5 AND 5.6
Backporting the patch and the test case fixed as part
of BUG#16041903 and BUG#19683834 respectively.
2015-01-27 13:13:55 +05:30
Sergei Golubchik
3fcbd7cb47 cleanup: remove unused THD::COND_wsrep_thd 2015-01-11 15:49:23 +01:00
Sergey Vojtovich
6dbc48ca79 MDEV-7324 - Lock-free hash for table definition cache 2014-12-28 19:46:18 +04:00
Alexander Barkov
c6d3f8058d MDEV-7112 Split HA_CREATE_INFO 2014-12-08 10:56:08 +04:00
Kristian Nielsen
db21fddc37 MDEV-6676: Optimistic parallel replication
Implement a new mode for parallel replication. In this mode, all transactions
are optimistically attempted applied in parallel. In case of conflicts, the
offending transaction is rolled back and retried later non-parallel.

This is an early-release patch to facilitate testing, more changes to user
interface / options will be expected. The new mode is not enabled by default.
2014-12-06 08:49:50 +01:00
Nirbhay Choubey
3bb02f3e6d bzr merge -rtag:mariadb-10.0.15 maria/10.0 2014-12-05 12:33:02 -05:00
Sergey Vojtovich
9e9f1da0d2 MDEV-7004 - Merge scalability fixes from 10.0-power
Remove call to deprecated set_thread_state. It is noop anyway, but generates
function call independently of performance schema state. According to perf
this saves ~0.2% of execution time.
2014-12-05 11:01:49 +04:00
Sergei Golubchik
0438f12540 MDEV-6980 OUT parameters in PREPARE
revert the patch for "out parameters in prepare"
2014-12-04 10:41:52 +01:00
Sergei Golubchik
ec4137c62b Merge branch '10.1' into bb-10.1-merge 2014-12-03 11:37:26 +01:00
Sergei Golubchik
853077ad7e Merge branch '10.0' into bb-10.1-merge
Conflicts:
	.bzrignore
	VERSION
	cmake/plugin.cmake
	debian/dist/Debian/control
	debian/dist/Ubuntu/control
	mysql-test/r/join_outer.result
	mysql-test/r/join_outer_jcl6.result
	mysql-test/r/null.result
	mysql-test/r/old-mode.result
	mysql-test/r/union.result
	mysql-test/t/join_outer.test
	mysql-test/t/null.test
	mysql-test/t/old-mode.test
	mysql-test/t/union.test
	packaging/rpm-oel/mysql.spec.in
	scripts/mysql_config.sh
	sql/ha_ndbcluster.cc
	sql/ha_ndbcluster_binlog.cc
	sql/ha_ndbcluster_cond.cc
	sql/item_cmpfunc.h
	sql/lock.cc
	sql/sql_select.cc
	sql/sql_show.cc
	sql/sql_update.cc
	sql/sql_yacc.yy
	storage/innobase/buf/buf0flu.cc
	storage/innobase/fil/fil0fil.cc
	storage/innobase/include/srv0srv.h
	storage/innobase/lock/lock0lock.cc
	storage/tokudb/CMakeLists.txt
	storage/xtradb/buf/buf0flu.cc
	storage/xtradb/fil/fil0fil.cc
	storage/xtradb/include/srv0srv.h
	storage/xtradb/lock/lock0lock.cc
	support-files/mysql.spec.sh
2014-12-02 22:25:16 +01:00
Sergei Petrunia
3d5f97fd70 Merge ../10.1-explain-json-r4 into 10.1 2014-11-27 00:51:54 +03:00
Nirbhay Choubey
6f65d2d114 MDEV-6924 : Server crashed on CREATE TABLE ... SELECT
Do not allow server to start if binlog_format is set
to a format other than ROW. Also restrict the change
of GLOBAL/SESSION binlog_format value at runtime.
2014-11-17 11:56:03 -05:00
Kristian Nielsen
26b1113032 MDEV-6917: Parallel replication: "Commit failed due to failure of an earlier commit on which this one depends", but no prior failure seen
This bug was seen when parallel replication experienced a deadlock between
transactions T1 and T2, where T2 has reached the commit phase and is waiting
for T1 to commit first. In this case, the deadlock is broken by sending a kill
to T2; that kill error is then later detected and converted to a deadlock
error, which causes T2 to be rolled back and retried.

The problem was that the kill caused ha_commit_trans() to errorneously call
wakeup_subsequent_commits() on T3, signalling it to abort because T2 failed
during commit. This is incorrect, because the error in T2 is only a temporary
error, which will be resolved by normal transaction retry. We should not
signal error to the next transaction until we have executed the code that
handles such temporary errors.

So this patch just removes the calls to wakeup_subsequent_commits() from
ha_commit_trans(). They are incorrect in this case, and they are not needed in
general, as wakeup_subsequent_commits() must in any case be called in
finish_event_group() to wakeup any transactions that may have started to wait
after ha_commit_trans(). And normally, wakeup will in fact have happened
earlier, either from the binlog group commit code, or (in case of no
binlogging) after the fast part of InnoDB/XtraDB group commit.

The symptom of this bug was that replication would break on some transaction
with "Commit failed due to failure of an earlier commit on which this one
depends", but with no such failure of an earlier commit visible anywhere.
2014-11-13 11:01:31 +01:00
Kristian Nielsen
d08b893b39 MDEV-6775: Wrong binlog order in parallel replication: Intermediate commit
The code in binlog group commit around wait_for_commit that controls commit
order, did the wakeup of subsequent commits early, as soon as a following
transaction is put into the group commit queue, but before any such commit has
actually taken place. This causes problems with too early wakeup of
transactions that need to wait for prior to commit, but do not take part in
the binlog group commit for one reason or the other.

This patch solves the problem, by moving the wakeup to happen only after the
binlog group commit is completed.

This requires a new solution to ensure that transactions that arrive later
than the leader are still able to participate in group commit. This patch
introduces a flag wait_for_commit::commit_started. When this is set, a waiter
can queue up itself in the group commit queue.

This way, effectively the wait_for_prior_commit() is skipped only for
transactions that participate in group commit, so that skipping the wait is
safe. Other transactions still wait as needed for correctness.
2014-11-13 10:31:20 +01:00
Kristian Nielsen
fbc8768ce5 MDEV-7101: SAFE_MUTEX lock order warning when reusing wait_for_commit mutex
In SAFE_MUTEX builds, reset the wait_for_commit mutex (destroy and
re-initialise), so that SAFE_MUTEX lock order check does not become
confused when the mutex is re-used for a different purpose.
2014-11-13 09:19:12 +01:00
Oleksandr Byelkin
1827d9e6d1 MDEV-5231: Per query variables from Percona Server (rewritten) 2014-11-11 11:48:50 +01:00
Sergei Petrunia
47ced65566 MDEV-6388: ANALYZE $stmt output in the slow query log
Make log_slow_verbosity=explain actually print ANALYZE (that
is, EXPLAIN otuput with two extra columns).
2014-10-17 22:47:06 +04:00
Sergei Petrunia
d3bdc142b4 Merge branch '10.1' of github.com:MariaDB/server into 10.1 2014-10-17 14:21:40 +04:00
Sergei Petrunia
d44dd54bc8 MDEV-6400: "ANALYZE SELECT ... INTO @var" doesn't set @var
Make ANALYZE work for
- ANALYZE SELECT ... INTO @var
- ANALYZE INSERT SELECT ...;
- ANALYZE SELECT .. INTO OUTFILE
2014-10-17 14:18:10 +04:00
Sergei Petrunia
be1c17669c Merge ../10.1 into bb-10.1-explain-json 2014-10-15 17:21:59 +04:00
Sergei Golubchik
f62c12b405 Merge 10.0.14 into 10.1 2014-10-15 12:59:13 +02:00
Sergei Golubchik
a99af484cd MDEV-5317 out parameters in PREPARE "SELECT ... INTO"
originally based on the patch by Antony T Curtis
2014-10-10 22:27:39 +02:00
Sergei Golubchik
1e0a11a3c7 cleanup: class my_var
* split my_var class in three - base my_var and two descencants, move
  properties into descendants, remove if(), create a virtual method instead
* factor out the common code in the select_var_ident parser rule
2014-10-10 22:27:37 +02:00
Sergei Golubchik
8596b70f96 cleanup: simplify the usage of WSREP_FORMAT macro 2014-10-10 22:27:36 +02:00