Commit graph

164969 commits

Author SHA1 Message Date
Sergei Petrunia
66ff1632f5 MDEV-7860: EXPLAIN FORMAT=JSON crashes for loose scan query
(Based on original patch by Sanja Byelkin)
Make the code that produces JSON output handle LooseScan quick select.

The output we produce is compatible with MySQL 5.6.
2015-04-08 16:26:22 +03:00
Kristian Nielsen
82b9eb5e3a Merge MDEV-7910 into 10.1 2015-04-08 15:11:44 +02:00
Kristian Nielsen
b3c7c8cde8 MDEV-7910: innodb.binlog_consistent fails sporadically in buildbot
The test case was missing --source include/wait_for_binlog_checkpoint.inc.
So it could occasionally fail if the checkpoint managed to occur just at the
right point in time between fetching the two binlog positions to compare.
2015-04-08 15:08:53 +02:00
Kristian Nielsen
7ee1a41ce1 MDEV-7888, MDEV-7929: Parallel replication hangs sometimes on ANALYZE TABLE or DDL
Follow-up patch with 10.1-specific changes.

Add test cases that more closely resembles the original bug report (which uses
the 10.1-specific --slave-parallel-mode=optimistic).

Also fix the code so that ANALYZE statements are now marked as DDL, and will
not be attempted to speculatively run in parallel with other transactions.
2015-04-08 13:15:04 +02:00
Kristian Nielsen
48c10fb5f7 Merge MDEV-7888 and MDEV-7929 into 10.1. 2015-04-08 11:04:24 +02:00
Kristian Nielsen
3b961347db MDEV-7888, MDEV-7929: Parallel replication hangs sometimes on ANALYZE TABLE or DDL
The hangs occur when the group_commit_orderer object is freed before the last
mark_start_commit() call on it - this loses the wakeup to other waiting worker
threads, causing them to hang until killed manually.

The object was freed because wakeup_subsequent_commits() was called two early
in two places. For MDEV-7888, during ANALYZE TABLE, and for MDEV-7929 during
record_gtid() after processing a DDL event. The group_commit_orderer object
can be freed when its last transaction has called wait_for_prior_commit().

Fix by implementing a suspend/resume mechanism for wakeup_subsequent_commits()
that can be used in places where a transaction is committed without this being
the commit of the actual replication event group.

Also add a protection mechanism (that asserts in debug builds) which can
prevent the too-early free and hang if other similar bugs should remain in
other parts of the code.
2015-04-08 11:01:18 +02:00
Sergei Petrunia
2b475b567e MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
- JOIN::save_explain_data should also set JOIN::tracker (it already
  sets join_tab[0].tracker). This is needed for UNIONs inside subqueries.
2015-04-08 03:33:48 +03:00
Sergei Petrunia
0df8c0aa5e Merge branch 'bb-10.1-explain-analyze' into 10.1 2015-04-07 12:02:58 +03:00
Sergei Petrunia
6be0f80311 Merge branch 'bb-10.1-explain-analyze' of github.com:MariaDB/server into bb-10.1-explain-analyze 2015-04-07 12:01:43 +03:00
Sergei Petrunia
129822a2b7 Merge branch 'bb-10.1-explain-analyze' into 10.1 2015-04-07 12:00:23 +03:00
Sergei Petrunia
2af935c8ec MDEV-7899: 10.1 is 3% slower than 10.0 in OLTP RO
- Remove ANALYZE's timing code off the the execution path of regular
  SELECTs.
- Improve the tracker that tracks counts/execution times of SELECTs or
  DML statements:
  = regular execution just increments counters
  = ANALYZE will also collect timings.
2015-04-07 01:29:17 +03:00
Sergei Petrunia
7d9e94e2e6 MDEV-7916: main.analyze_format_json fails in buildbot on labrador
Make the test work on case insensitive FS
2015-04-06 19:37:37 +03:00
Elena Stepanova
eb83e9405f MDEV-7917 main.log_tables fails sporadically in buildbot #2
mysql.slow_log table has an extra column in 10.1, so the test
table copy should too -- added the column.
2015-04-06 19:13:33 +03:00
Sergei Petrunia
2f6d63f063 Merge branch '10.1' of github.com:MariaDB/server into 10.1 2015-04-06 18:56:39 +03:00
Sergei Petrunia
2936fb127d MDEV-7919: main.explain_json* fail in buildbot with valgrind
Correctly initialize Explain_node::connection_type, remove unused
Explain_node constructor.
2015-04-06 18:54:08 +03:00
Jan Lindström
3674c363a7 MDEV-7918: A number of tests fail in valgrind builder with "InnoDB: Error: Requested state 6 current state 4 old_state 4"
Problem with this state transfer is that different state transfers
are protected with different mutexes.
2015-04-06 12:45:35 +03:00
Sergei Petrunia
47c344b00f MDEV-7904: ANALYZE FORMAT=JSON doesn't print r_rows for union output
Print r_rows. There is no table tracking for reading from tmp table, yet.
2015-04-04 00:47:10 +03:00
Oleksandr Byelkin
a220905083 MDEV-7833:ANALYZE FORMAT=JSON and Range checked for each record 2015-04-03 15:37:27 +02:00
Alexander Barkov
7f613ebdb6 MDEV-7284 INDEX: CREATE OR REPLACE 2015-04-03 15:43:55 +04:00
Jan Lindström
118fc5c688 Adjust test timeout to let long semaphore wait signaling to happen. 2015-04-03 08:50:59 +03:00
Nirbhay Choubey
575dd77504 MDEV-7867: Add binlog header to GRA_.log file 2015-04-01 18:25:40 -04:00
Jan Lindström
ca2f2b7151 Adjust test wait timeout. 2015-03-31 09:54:40 +03:00
Jan Lindström
cbc5157feb MDEV-7878: innodb_scrub_background fails sporadically in buildbot (Failing assertion: offset > 0 && offset < UNIV_PAGE_SIZE)
Problem was that when encrypted space was flushed page 0 is
also updated but crypt data offset was sometimes not
calculated.
2015-03-31 09:00:01 +03:00
Kristian Nielsen
f573b65e41 Merge MDEV-7847 and MDEV-7882 into 10.0.
Conflicts:
	mysql-test/suite/rpl/r/rpl_parallel.result
	sql/rpl_parallel.cc
2015-03-30 15:10:29 +02:00
Kristian Nielsen
880f2273fd MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging
This patch fixes a bug in the error handling in parallel replication, when one
worker thread gets a failure and other worker threads processing later
transactions have to rollback and abort.

The problem was with the lifetime of group_commit_orderer objects (GCOs).
A GCO is freed when we register that its last event group has committed. This
relies on register_wait_for_prior_commit() and wait_for_prior_commit() to
ensure that the fact that T2 has committed implies that any earlier T1 has
also committed, and can thus no longer execute mark_start_commit().

However, in the error case, the code was skipping the
register_wait_for_prior_commit() and wait_for_prior_commit() calls. Thus
commit ordering was not guaranteed, and a GCO could be freed too early. Then a
later mark_start_commit() would reference deallocated GCO, which could lead to
lost wakeup (causing slave threads to hang) or other corruption.

This patch makes also the error case respect commit order. This way, also the
error case gets the GCO lifetime correct, and the hang no longer occurs.
2015-03-30 14:33:44 +02:00
Kristian Nielsen
a4082918c8 MDEV-7882: Excessive transaction retry in parallel replication
When a transaction in parallel replication needs to retry (eg. because of
deadlock kill), first wait for all prior transactions to commit before doing
the retry. This way, we avoid the retry once again conflicting with a prior
transaction, requiring yet another retry.

Without this patch, we saw "in the wild" that transactions had to be retried
more than 10 times to succeed, which exceeds the default
--slave_transaction_retries value and is in any case undesirable.

(We already do this in 10.1 in "optimistic" parallel replication mode; this
patch just makes the code use the same logic for "conservative" mode (only
mode in 10.0)).
2015-03-30 14:16:57 +02:00
Alexander Barkov
59df100922 Removing Item_string::m_cs_specified and
making Item_string::is_cs_specified() virtual instead.
2015-03-30 10:57:44 +04:00
Elena Stepanova
49220f76aa Increased the version number 2015-03-30 01:11:14 +03:00
Elena Stepanova
bf963d3b52 MDEV-7874 deb package installation fails with "dpkg: dependency problems prevent configuration of mariadb-server"
Added usr/share/mysql/maria_add_gis_sp_bootstrap.sql to the file lists
2015-03-30 01:09:59 +03:00
Oleksandr Byelkin
b2a1187307 MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print the r_total_time_ms
Tracking total time added in UPDATE/DELETE
Fixed selectivity calculation in UPDATE/DELETE
Macro definitions of time tracting fixed.
2015-03-29 15:33:15 +02:00
Sergei Petrunia
9b8f86f895 Better comments 2015-03-27 23:44:06 +03:00
Jan Lindström
47c26d5aee Skip necessary encryption tests if required plugin is not found. 2015-03-27 11:36:43 +02:00
Alexander Barkov
50eee60504 Preparatory refactoring for:
MDEV-6218 Wrong result of CHAR_LENGTH(non-BMP-character) with 3-byte utf8
- Moving get_text() as a method to Lex_input_stream.
- Moving the unescaping part into a separate function,
  this piece of code will later go to /strings most likely.
- Removing Lex_input_string::yytoklen, as it's not needed any more.
2015-03-26 20:44:12 +04:00
Oleksandr Byelkin
01d7da6785 MDEV-7834: ANALYZE FORMAT=JSON output column should be named ANALYZE 2015-03-25 19:55:11 +01:00
Sergei Petrunia
e15d792697 Trivial test results updates 2015-03-25 21:21:01 +03:00
Sergei Petrunia
3841e921ba Merge branch 'bb-10.1-explain-analyze' into 10.1 2015-03-25 21:07:23 +03:00
Sergei Petrunia
34fcc28e7b Merge pull request #33 from k0da/mdev-7839
Fix BigEndian build for Cassandra SE
2015-03-25 19:34:08 +03:00
Dinar Valeev
71bbff8de3 Fix BigEndian build
On BigEndian build fails with:
[ 109s]
/home/abuild/rpmbuild/BUILD/mariadb-10.0.17/storage/cassandra/ha_cassandra.cc:890:22:
error: invalid conversion from 'longlong*
{aka long long int*}

' to 'long long int' [-fpermissive]
[ 109s] value->x.long_value= (longlong *)*cass_data;
[ 109s] ^

This commit fixes it

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
2015-03-25 17:21:52 +01:00
Sergei Petrunia
f42064a172 Fix valgrind failure: correclty clean up handler::tracker 2015-03-25 12:20:16 +03:00
Alexander Barkov
651a142ad0 MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND) 2015-03-25 13:06:04 +04:00
Kristian Nielsen
bd2ae787ea MDEV-7825: Parallel replication race condition on gco->flags, possibly resulting in slave hang
The patch for optimistic parallel replication as a memory optimisation moved
the gco->installed field into a bit in gco->flags. However, that is just plain
wrong. The gco->flags field is owned by the SQL driver thread, but
gco->installed is used by the worker threads, so this will cause a race
condition.

The user-visible problem might be conflicts between transactions and/or slave
threads hanging.

So revert this part of the optimistic parallel replication patch, going back
to using a separate field gco->installed like in 10.0.
2015-03-24 16:33:51 +01:00
Sergei Petrunia
664ce4c507 Fix linking: move the inline functions 2015-03-24 17:35:29 +03:00
Sergei Petrunia
4106dfe89b Merge branch 'bb-10.1-explain-analyze' into 10.1 2015-03-24 16:26:42 +03:00
Sergei Petrunia
77e16ce7d6 MDEV-7648: Extra data in ANALYZE FORMAT=JSON $stmt
Switch from relying on PERFORMANCE_SCHEMA to using our
own hooks for counting the time spent reading rows from
tables.
2015-03-24 16:17:41 +03:00
Sergei Petrunia
b273e4a5c0 Better comments 2015-03-24 13:22:03 +03:00
Alexander Barkov
ec68494beb MDEV-7677 my_charset_handler_filename has a wrong "ismbchar" member 2015-03-23 17:38:55 +04:00
Vicențiu Ciorbaru
4fbba09824 MDEV-7813 analyze_stmt fails with --embedded flag set
Moved the privilege checking code which does not apply for embedded
to a separate test case.
2015-03-21 19:56:31 +02:00
Jan Lindström
3578419b77 MDEV-7797: file_key_management_plugin uses static IV for a key
Currently crypt data is written to file space always. Use
that to obtain random IV for every object (file).

Beatify code to confort InnoDB coding styles.

Conflicts:
	storage/innobase/fil/fil0crypt.cc
	storage/xtradb/fil/fil0crypt.cc
2015-03-20 13:09:07 +02: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
Alexander Barkov
2a2cc16478 Refactoring in sql_yacc.yy. A pre-requirement patch for
MDEV-7801 Unexpected syntax error in ALTER TABLE t1 ADD INDEX TYPE BTREE
MDEV-7284 INDEX: CREATE OR REPLACE
2015-03-20 11:46:44 +04:00