Commit graph

645 commits

Author SHA1 Message Date
Monty
494c981d23 Merge remote-tracking branch 'origin/10.1' into 10.2 2018-05-24 18:57:52 +03:00
Marko Mäkelä
bfed1bfe28 Add a missing dependency to a test 2018-05-24 11:55:27 +03:00
sachin
5797cbaf4a MDEV-10259 mysqld crash with certain statement length and...
order with Galera and encrypt-tmp-files=1

Problem:- If trans_cache (IO_CACHE) uses encrypted tmp file
then on next DML server will crash.

Case:-
 Lets take a case , we have a table t1 , We try to do 2 inserts in t1
  1. A really long insert so that trans_cache has to use temp_file
  2. Just a small insert

Analysis:- Actually server crashes from inside of galera
library.
/lib64/libc.so.6(abort+0x175)[0x7fb5ba779dc5]
/usr/lib64/galera/libgalera_smm.so(_ZN6galera3FSMINS_9TrxHandle5State...
mysys/stacktrace.c:247(my_print_stacktrace)[0x7fb5a714940e]
sql/signal_handler.cc:160(handle_fatal_signal)[0x7fb5a715c1bd]
sql/wsrep_hton.cc:257(wsrep_rollback)[0x7fb5bcce923a]
sql/wsrep_hton.cc:268(wsrep_rollback)[0x7fb5bcce9368]
sql/handler.cc:1658(ha_rollback_trans(THD*, bool))[0x7fb5bcd4f41a]
sql/handler.cc:1483(ha_commit_trans(THD*, bool))[0x7fb5bcd4f804]

but actual issue is not in galera but in mariadb, because for 2nd
insert we should never call rollback. We are calling rollback because
log_and_order fails it fails because write_cache fails , It fails
because after reinit_io_cache(trans_cache) , my_b_bytes_in_cache says 0
so we look into tmp_file for data , which is obviously wrong since temp
was used for previous insert and it no longer exist.
wsrep_write_cache_inc() reads the IO_CACHE in a loop, filling it with
my_b_fill() until it returns "0 bytes read". Later
MYSQL_BIN_LOG::write_cache() does the same.  wsrep_write_cache_inc()
assumes that reading a zero bytes past EOF leaves the old data in the
cache

Solution:- There is two issue in my_b_encr_read
1st we should never equal read_end to info->buffer. I mean this
does not make sense read_end should always point to end of buffer.
2nd For most of the case(apart from async IO_CACHE) info->pos_in_file
should be equal to info->buffer position wrt to temp file , since
in this case we are not changing info->buffer it should remain
unchanged.
2018-05-22 13:47:42 +05:30
Sergei Golubchik
182db5a1b7 disable galera.pxc-421 test 2018-05-15 12:10:48 +02:00
Marko Mäkelä
8c4f3b316e After-merge fix 2018-05-12 10:27:19 +03:00
Sergei Golubchik
9b1824dcd2 Merge branch '10.1' into 10.2 2018-05-10 13:01:42 +02:00
Jan Lindström
2e5681a450 Test requires galera debug library. 2018-05-08 09:33:48 +03:00
Teemu Ollakka
f8ea96b80c codership/galera#500 MTR test for proper Galera provider tear down
Added a test which verifies that if the gcomm background thread
is forced to quit via exception, the error is propagated all the
way up the stack and wsrep_ready becomes 0.
2018-05-08 09:04:35 +03:00
Daniele Sciascia
7274bed257 Fix MTR test galera.galera_gcache_recover_manytrx
The kills the two nodes that compose the cluster and then recovers them.
The first node that is recovered is expected to recover its gcache, so
that when the second node is recovered, it is expected that it rejoins
the cluster via IST.
However, it is possible that if the second node is killed while it is
applying in TOI mode, its local state is marked unsafe. In which case,
SST is the only option to rejoin the cluster.

codership/mysql-wsrep#323
2018-05-08 09:04:31 +03:00
Daniele Sciascia
ba07581c81 Galera MTR tests: remove unused config files in galera suite 2018-05-08 09:04:08 +03:00
Daniele Sciascia
0088fb91f3 Fix sporadic failure of MTR test galera.galera_many_tables_pk
The test relies on the false assumption that node_1 is always
"assigned" autoincrement value 1 for a given key.
However that is no necessarily the case when wsrep autoincrement
control is enabled.

This patch changed the test so that it does not make use of a
autoincrement key, which is not fundamental for the test itself.

codership/mysql-wsrep#322
2018-05-08 09:03:02 +03:00
Jan Lindström
e1ffb66449 Merge tag 'mariadb-10.0.35' into 10.0-galera 2018-05-07 17:20:39 +03:00
Jan Lindström
648cf7176c Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galera 2018-05-07 13:49:14 +03:00
Jan Lindström
cf333b7fda
Merge branch '10.1' into MDEV-15803 2018-04-30 12:54:14 +03:00
Jan Lindström
89a7ad636c
Merge pull request #732 from codership/galera_gcs_fragment_auto_inc
Save / restore auto_increment_offset in test galera_gcs_fragment
2018-04-30 07:36:16 +03:00
Jan Lindström
ed1d9c802d
Merge pull request #729 from codership/MDEV-15794
MDEV-15794 Fix and re-enable test galera_var_retry_autocommit
2018-04-27 14:42:47 +03:00
Daniele Sciascia
b8d4ae0838 Save / restore auto_increment_offset in test galera_gcs_fragment
Test galera_gcs_fragment performs cluster reconfiguration, so
`auto_increment_offset` may change, and check test case at the
end of test fails.
2018-04-27 12:02:23 +02:00
Daniele Sciascia
74f22939dc MDEV-15803 Fix and re-enable test galera_var_auto_inc_control_on
The test assumes that `@@global.auto_increment_offset` is equal to
`wsrep_local_index + 1`. Which is normally the case if galera runs
with option `wsrep_auto_increment_control` enabled.
However, if some prior test performs a restart of a server, then
`wsrep_local_index` may change, and galera will set the value of
`auto_increment_offset` accordingly.
However, if `auto_increment_offset` changes during a test run, then
mtr will complain. To avoid that, tests that perform restarts include
`auto_increment_offset_save.inc` and `auto_increment_offset_restore.inc`.
Which reset the value of `auto_increment_offset`. And when that
happens, `auto_increment_offset` will no longer be equal to
`wsrep_local_index + 1`, and the test fails.
To avoid this problem, simply check that the offsets are different
on the nodes that compose the cluster.
2018-04-27 11:05:04 +02:00
Daniele Sciascia
9f9bce5f3e MDEV-13549 Record and re-enable galera_ist_mysqldump
Test works after fixes for galera_sst_mysqldump.
2018-04-26 13:58:31 +02:00
Daniele Sciascia
58c03e8f30 MDEV-15794 Fix and re-enable test galera_var_retry_autocommit
The test was not deterministic and would occasionally fail, due to the
use of `sleep`.
This patch is a complete rewrite of the test using proper sync points.
2018-04-26 13:03:51 +02:00
Jan Lindström
dc0613edc4 MDEV-15809: Test failure on galera.MW-44
Disable general log while truncating mysql.general_log to
avoid queries to be inserted there.
2018-04-26 12:23:19 +03:00
Jan Lindström
779343235b
Merge pull request #722 from codership/MDEV-16006
MDEV-16006 Fix test galera_kill_nochanges
2018-04-25 10:24:08 +03:00
Daniele Sciascia
dfb1fdabab MDEV-16006 Fix test galera_kill_nochanges
The test performs a restart and while doing so it occasionally
fails with "Server did not transition to READY state" in
`include/start_mysqld.inc".
Fix is to wait for the cluster to shrink before restarting
the node.
2018-04-24 16:32:44 +02:00
Daniele Sciascia
92cd6bb510 MDEV-15811 Fix and re-enable test galera.galera_pc_ignore_sb
* After killing one galera node with include/kill_galera,
  wait for cluster to shrink

* Remove unnecessary include/wait_until_connected_again.inc
2018-04-24 14:29:56 +02:00
Marko Mäkelä
4cd7979c56 Merge 10.1 into 10.2 2018-04-24 09:39:45 +03:00
Jan Lindström
82d4f08186
Merge pull request #713 from codership/MDEV-15948
MDEV-15948 Fix error "Lost connection to MySQL server..." in test gal…
2018-04-23 14:25:34 +03:00
Daniele Sciascia
63e5307afd MDEV-15948 Followup commit
* Increased timeout counter in galera_wait_ready.inc

* Replaced useless include/wait_until_ready.inc after start_mysqld.inc
  in galera_st_*.inc with wait_condition on cluster size.
2018-04-23 12:00:49 +02:00
Marko Mäkelä
619dc2b24f Fix test results after merge from 10.1 2018-04-23 09:44:39 +03:00
Marko Mäkelä
ea94717983 Merge 10.1 into 10.2 2018-04-21 11:58:32 +03:00
Daniele Sciascia
9e5671f1cc MDEV-15948 Fix error "Lost connection to MySQL server..." in test galera_sst_mysqldump
Test galera_sst_mysqldump often fails with error "2013: Lost connection
to MySQL server during query". The connection is lost after the test
restart one of the nodes. This happens because the server closes client
connections if it is joining a cluster through SST method mysqldump.
On unlucky runs of the test it is possible that mysqld is restarted,
and then mtr client is disconnected while it tries to determine if
galera is ready before going on with the test.
This patch rewrites galera_wait_ready.inc so that it is immune to
being disconnected.
2018-04-20 14:44:27 +02:00
Sachin Setiya
efae12680e MDEV-15611 Due to the failure of foreign key detection, Galera...
slave node killed himself.

Problem:- If we try to delete table with foreign key and table whom it is
referring with wsrep_slave_threads>1 then galera tries to execute both
Delete_rows_log-event in parallel, which should not happen.

Solution:- This is happening because we do not have foreign key info in
write set. Upto version 10.2.7 it used to work fine. Actually it happening
because of issue in commit 2f342c4. wsrep_must_process_fk has changed to
make it similar to original condition.
2018-04-19 16:33:49 +05:30
Daniele Sciascia
3aa5f00e69 MDEV-15929 Fix lock wait timeout on SELECT @@GLOBAL.WSREP_ON
This patch fixes a lock wait timeout error on `SELECT @@GLOBAL.WSREP_ON`
in `wait_wsrep_ready.inc`:

```
--connection node_2
...
--source include/kill_galera.inc

--connection node_1
--source include/wait_until_connected_again.inc # This includes wait_wsrep_ready.inc

```

The problem is that on node_2, kill_galera.inc may return before
the node is killed. So node_1 may still see that node_1 is alive
and will attempt to sync wait when doing those `SELECT` statements.
But sync wait is doomed to fail given that node_1 is killed, hence
the lock wait timeout.
One possible fix is to disable wsrep_sync_wait before including
wait_until_connected_again.
However, it appears that including wait_until_connected_again is
not necessary at all in node_1, so this patch removes it altogether.
2018-04-19 10:48:29 +02:00
Jan Lindström
c6c679e947
Merge pull request #700 from codership/MDEV-15804
MDEV-15804 Fix and re-enable MTR test galera.pxc-421
2018-04-11 16:19:59 +03:00
Daniele Sciascia
4dc60dc3f1 MDEV-15804 Fix and re-enable MTR test galera.pxc-421
This patch makes two changes:

* Remove unnecessary `set SESSION wsrep_sync_wait=0`.
  Disabling `wsrep_sync_wait` caused the test to fail occasionally,
  due to subsequent `SELECT`s observing stale values.

* Remove redundant `--source include/galera_wait_ready.inc`,
  `galera_wait_ready.inc` is already included in the above
  `wait_until_connected_again.inc`
2018-04-11 14:24:39 +02:00
Daniele Sciascia
73b3ace8b2 MDEV-15808 Fix and re-enable test galera.galera_gra_log
Test would occasionally fail as follows:

```
mysqltest: At line 20: query 'SELECT COUNT(*) = 0 FROM t1' failed:
1317: Query execution was interrupted

```

This was due to a `CREATE TABLE` applied concurrently that would
occasionally cause the `SELECT` to be BF aborted, due to MDL
conflict.

The `SELECT` is executed while `wsrep_on=OFF`. The change makes sure
it is executed only after wsrep is enabled again.
2018-04-11 09:14:35 +02:00
Vicențiu Ciorbaru
45e6d0aebf Merge branch '10.1' into 10.2 2018-04-10 17:43:18 +03:00
Jan Lindström
1fd07d21a7 MDEV-15823: Test failure on galera.galera_var_slave_threads
Wait drop table to be replicated before continuing.
2018-04-10 13:25:19 +03:00
Jan Lindström
803ded5148 MDEV-13549: Galera test failures
Disable occasionally failing test case galera.galera_var_slave_threads.
2018-04-09 14:43:32 +03:00
Jan Lindström
fe61e287e9 MDEV-15810: Test failure on galera.lp1376747 and galera.lp1376747-2
Wait until create table is replicated before continuing.
2018-04-09 07:49:00 +03:00
Jan Lindström
767d6ce38c MDEV-15807: Test failure on galera.galera_lock_table
Wait until create tables are replicated to the slave before trying
lock table.
2018-04-09 07:28:13 +03:00
Jan Lindström
8bb40f2404 MDEV-13549: Galera test failures
Disable more occasionally failing test cases.
	galera.galera_lock_table
	galera.galera_gra_log
	galera.MW-44
	galera.lp1376747
	galera.lp1376747-2
	galera.galera_pc_ignore_sb
2018-04-08 13:04:38 +03:00
Jan Lindström
1568950a7d MDEV-15806: Test failure on galera.galera_parallel_simple
Make sure DDL's (create tables) are replicated before continuing to
lock table.
2018-04-08 09:03:55 +03:00
Jan Lindström
c4b1a57b13 MDEV-13549: Galera test failures
Disable occasionally failing test cases
	pxc-421
	query_cache
	galera_parallel_simple
2018-04-08 08:24:36 +03:00
Jan Lindström
4ede2fec4c Disable galera_var_auto_inc_control_on test. 2018-04-07 08:52:24 +03:00
Jan Lindström
3756e27aa7
Merge pull request #694 from codership/MDEV-13549-fixes-for-galera_wsrep_desync_wsrep_on
MDEV-13549 Fix test galera.galera_wsrep_desync_wsrep_on
2018-04-07 08:51:33 +03:00
Jan Lindström
c0b781d25e Disable test galera_var_auto_inc_control_on as it fails. 2018-04-06 16:33:41 +03:00
Daniele Sciascia
7925cdff6b MDEV-13549 Fix test galera.galera_wsrep_desync_wsrep_on
The test tends to fail if many parallel instances of it are executed:

```
mysqltest: At line 23: query 'ALTER TABLE t1 ADD PRIMARY KEY (f1)' failed:
1317: Query execution was interrupted
```

The `ALTER` fails because it is BF aborted due to an earlier `INSERT SELECT`
that is being applied:

```
INSERT INTO t1 (f1) SELECT ...

--connection node_2
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;

ALTER TABLE t1 ADD PRIMARY KEY (f1);

SET SESSION wsrep_on = TRUE;
SET GLOBAL wsrep_desync = FALSE;
```

And because the `ALTER` is executed with `wsrep_on = OFF`, it does not
run in total order isolation.
To avoid the problem it must be ensured that the `ALTER` only after the
large `INSERT SELECT` is done. To do so it is sufficient to issue
`SELECT COUNT(*) FROM t1;` from `node_2` before turning off wsrep.
The `SELECT` will trigger `wsrep_sync_wait` and proceed only after the
`INSERT SELECT` from node_1 is done.
2018-04-06 15:15:44 +02:00
Jan Lindström
3be6cef593 MDEV-13549: Galera test failures
Fix test case galera_toi_ddl_nonconflicting as we need to wait
until both alter tables are finished on that Galera node.
2018-04-06 12:37:05 +03:00
Jan Lindström
d61ed5dd8a MDEV-13549: Galera test failures
Fix test case galera.pxc-421 to reset auto_increment_offset
correctly.
2018-04-06 12:28:48 +03:00
Jan Lindström
afbd45a791 MDEV-13549: Galera test failures
Enable tests that pass on 10.1:
       galera_var_auto_inc_control_on
       galera_var_retry_autocommit
       pxc-421
       lp1376747-2
       lp1376747
       galera_toi_ddl_nonconflicting
       galera_parallel_simple
       galera_admin
       galera_pc_ignore_sb
       galera_lock_table
       galera_unicode_identifiers
       galera.galera_gcs_fc_limit
       galera.galera_gtid
2018-04-05 17:15:40 +03:00