Commit graph

12318 commits

Author SHA1 Message Date
Kristian Nielsen
00164ea4b1 Merge branch 'gtid_table_garbage_rows_10.3' into 10.3 2018-10-13 19:50:53 +02:00
Vladislav Vaintroub
2fd770641e Revert the last change to replication test
disable rpl_mdev382 on Windows, due to unix shell escaping used there.
2018-10-12 20:07:08 +02:00
Vladislav Vaintroub
00c40efcd6 Fix portability issues with rpl test suite. 2018-10-12 16:43:45 +01:00
Alexander Barkov
6120ae4aca Adjusting old tests and adding new tests for "MDEV-8765: mysqldump -use utf8mb4 by default" 2018-10-12 06:34:13 +04:00
Marko Mäkelä
7e869a2767 Merge 10.2 into 10.3 2018-10-11 23:09:10 +03:00
Marko Mäkelä
81a5b6ccd5 MDEV-17433 Allow InnoDB start up with empty ib_logfile0 from mariabackup --prepare
A prepared backup from Mariabackup does not really need to contain any
redo log file, because all log will have been applied to the data files.

When the user copies a prepared backup to a data directory (overwriting
existing files), it could happen that the data directory already contained
redo log files from the past. mariabackup --copy-back) would delete the
old redo log files, but a user’s own copying script might not do that.
To prevent corruption caused by mixing an old redo log file with data
files from a backup, starting with MDEV-13311, Mariabackup would create
a zero-length ib_logfile0 that would prevent startup.

Actually, there is no need to prevent InnoDB from starting up when a
single zero-length file ib_logfile0 is present. Only if there exist
multiple data files of different lengths, then we should refuse to
start up due to inconsistency. A single zero-length ib_logfile0 should
be treated as if the log files were missing: create new log files
according to the configuration.

open_log_file(): Remove. There is no need to open the log files
at this point, because os_file_get_status() already determined
the size of the file.

innobase_start_or_create_for_mysql(): Move the creation of new
log files a little later, not when finding out that the first log
file does not exist, but after finding out that it does not exist
or it exists as a zero-length file.
2018-10-11 23:00:48 +03:00
Marko Mäkelä
6319c0b541 MDEV-13564: Replace innodb_unsafe_truncate with innodb_safe_truncate
Rename the 10.2-specific configuration option innodb_unsafe_truncate
to innodb_safe_truncate, and invert its value.

The default (for now) is innodb_safe_truncate=OFF, to avoid
disrupting users with an undo and redo log format change within
a Generally Available (GA) release series.
2018-10-11 15:10:13 +03:00
Marko Mäkelä
ae9d82c9f8 Merge 10.2 into 10.3 2018-10-11 08:22:08 +03:00
Marko Mäkelä
3448ceb02a MDEV-13564: Implement innodb_unsafe_truncate=ON for compatibility
While MariaDB Server 10.2 is not really guaranteed to be compatible
with Percona XtraBackup 2.4 (for example, the MySQL 5.7 undo log format
change that could be present in XtraBackup, but was reverted from
MariaDB in MDEV-12289), we do not want to disrupt users who have
deployed xtrabackup and MariaDB Server 10.2 in their environments.

With this change, MariaDB 10.2 will continue to use the backup-unsafe
TRUNCATE TABLE code, so that neither the undo log nor the redo log
formats will change in an incompatible way.

Undo tablespace truncation will keep using the redo log only. Recovery
or backup with old code will fail to shrink the undo tablespace files,
but the contents will be recovered just fine.

In the MariaDB Server 10.2 series only, we introduce the configuration
parameter innodb_unsafe_truncate and make it ON by default. To allow
MariaDB Backup (mariabackup) to work properly with TRUNCATE TABLE
operations, use loose_innodb_unsafe_truncate=OFF.

MariaDB Server 10.3.10 and later releases will always use the
backup-safe TRUNCATE TABLE, and this parameter will not be
added there.

recv_recovery_rollback_active(): Skip row_mysql_drop_garbage_tables()
unless innodb_unsafe_truncate=OFF. It is too unsafe to drop orphan
tables if RENAME operations are not transactional within InnoDB.

LOG_HEADER_FORMAT_10_3: Replaces LOG_HEADER_FORMAT_CURRENT.

log_init(), log_group_file_header_flush(),
srv_prepare_to_delete_redo_log_files(),
innobase_start_or_create_for_mysql(): Choose the redo log format
and subformat based on the value of innodb_unsafe_truncate.
2018-10-11 08:17:04 +03:00
Marko Mäkelä
07815d9555 Merge 10.1 into 10.2 2018-10-11 08:16:08 +03:00
Jan Lindström
3c3c4ae225 MDEV-17403: Test failure on galera.galera_enum
Add wait on second node.
2018-10-10 09:17:10 +03:00
Marko Mäkelä
61b32df931 Merge 10.2 into 10.3 2018-10-10 06:45:19 +03:00
Marko Mäkelä
00b6c7d8fc MDEV-16946 innodb.alter_kill failed in buildbot with wrong result
Ensure that no redo log checkpoint occurs in a critical section
of a recovery test.
2018-10-10 06:31:43 +03:00
Marko Mäkelä
2610c26a53 MDEV-16273 innodb.alter_kill fails Unknown storage engine 'InnoDB'
The test is shutting down InnoDB, corrupting a file, and finally
restarting InnoDB. Before the shutdown, the test created the table
and inserted some records. Before MDEV-12288, there would be no access
to the table after server restart, but after MDEV-12288 purge would
reset the transaction identifier after the INSERT, and this would
sometimes happen after the restart.

To make the test deterministic, wait for purge to complete before the
shutdown.
2018-10-10 06:14:14 +03:00
Marko Mäkelä
43ee6915fa Merge 10.2 into 10.3 2018-10-09 09:11:30 +03:00
Thirunarayanan Balathandayuthapani
e9d9ca8c44 MDEV-16980 Wrongly set tablename len while opening the
table for purge thread

Problem:
=======
	Purge tries to fetch mdl lock for the whole table even though it tries
to open one of the partition. But table name length was wrongly set to indicate
the partition name too.

Solution:
========
- Table name length should identify the table name only not the partition name.
2018-10-08 21:40:18 +05:30
Thirunarayanan Balathandayuthapani
7d4beb7286 MDEV-16980 Wrongly set tablename len while opening the
table for purge thread

Problem:
=======
	Purge tries to fetch mdl lock for the whole table even though it tries
to open one of the partition. But table name length was wrongly set to indicate
the partition name too.

Solution:
========
- Table name length should identify the table name only not the partition name.
2018-10-08 21:06:42 +05:30
Kristian Nielsen
3eb2c46644 Merge branch 'gtid_table_garbage_rows' into gtid_table_garbage_rows_10.3 2018-10-07 23:40:32 +02:00
Kristian Nielsen
2f4a0c5be2 Fix accumulation of old rows in mysql.gtid_slave_pos
This would happen especially in optimistic parallel replication, where there
is a good chance that a transaction will be rolled back (due to conflicts)
after it has executed record_gtid(). If the transaction did any deletions of
old rows as part of record_gtid(), those deletions will be undone as well.
And the code did not properly ensure that the deletions would be re-tried.

This patch makes record_gtid() remember the list of deletions done as part
of a transaction. Then in rpl_slave_state::update() when the changes have
been committed, we discard the list. However, in case of error and rollback,
in cleanup_context() we will instead put the list back into
rpl_global_gtid_slave_state so that the deletions will be re-tried later.

Probably fixes part of the cause of MDEV-12147 as well.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2018-10-07 18:59:52 +02:00
Marko Mäkelä
1ff22b2062 MDEV-17289: Skip the test for non-debug server 2018-10-06 13:43:13 +03:00
Thirunarayanan Balathandayuthapani
33fadbfefc MDEV-17289: Add a test case 2018-10-05 17:36:31 +03:00
Marko Mäkelä
29703e4f87 Fix a Galera result 2018-10-05 16:45:58 +05:30
Thirunarayanan Balathandayuthapani
6f2389b22d - Added flush table at the beginning of crash_recovery test case. 2018-10-05 16:45:27 +05:30
Marko Mäkelä
2badefb066 Fix a Galera result 2018-10-04 16:08:25 +03:00
Jan Lindström
e855912733 Test by reverting MDEV-16656: DROP DATABASE crashes the Galera Cluster 2018-10-04 13:29:29 +03:00
Jan Lindström
6c29544c20 Enable for staging tree. 2018-10-04 08:05:50 +03:00
Jan Lindström
391b7f5bd1 Fix typo. 2018-10-04 08:04:55 +03:00
Jan Lindström
e2a1c58582 Fix test failure on wsrep.variables
SLES11 can't build currently latest Galera library version.
2018-10-04 07:13:30 +03:00
Jan Lindström
84a24d36d8 MDEV-17357: Test failure on galera.galera_pc_ignore_sb
Add wait until cluster has correct number of nodes.
2018-10-04 07:13:07 +03:00
Eugene Kosov
44016ec0ca MDEV-16211 Contents of transaction_registry not replicated by Galera
Patch fixes two bugs:
1) BEGIN_TIMESTAMP of MYSQL.TRANSACTION_REGISTY is '0-0-0' on replication record insertion
2) BEGIN_TIMESTAMP equals COMMMIT_TIMESTAMP in MYSQL.TRANSACTION_REGISTRY

Fixed by calling THD::set_time() at appropriate places
2018-10-01 17:53:20 +03:00
Jan Lindström
649451ae0d
Merge pull request #875 from tempesta-tech/sysprg/MDEV-16656
MDEV-16656: DROP DATABASE crashes the Galera Cluster
2018-10-01 12:47:35 +03:00
Sachin
865237e5af Fix rpl_parallel_optimistic_nobinlog failure on binlog 2018-10-01 15:15:34 +05:30
Julius Goryavsky
c62e49d0cf MDEV-16656: DROP DATABASE crashes the Galera Cluster
When converting table identifiers to a new format,
some tables can be renamed twice, which subsequently
leads to the appearance of "false" auxiliary tables
belonging to another main (parent) table (which does
not actually have auxiliary tables).

This is because the table number is repeatedly added
to the aux_tables_to_rename vector inside the function
fts_check_and_drop_orphaned_tables.

To correct this error, we must add a check for the
occurrence of the table number in the aux_tables_to_rename
vector before adding a new element.

https://jira.mariadb.org/browse/MDEV-16656
2018-10-01 09:53:37 +02:00
Sergei Golubchik
6d2c70bc55 Update test result (after galera library upgrade?) 2018-09-28 16:37:55 +02:00
Sergei Golubchik
57e0da50bb Merge branch '10.2' into 10.3 2018-09-28 16:37:06 +02:00
Marko Mäkelä
304857764b MDEV-13564 Mariabackup does not work with TRUNCATE
Implement undo tablespace truncation via normal redo logging.

Implement TRUNCATE TABLE as a combination of RENAME to #sql-ib name,
CREATE, and DROP.
2018-09-25 17:29:43 +03:00
Sergei Golubchik
5ae8fce50b Merge branch '10.1' into 10.2 2018-09-24 11:46:08 +02:00
Sergei Golubchik
1fc5a6f30c Merge branch '10.0' into 10.1 2018-09-23 12:58:11 +02:00
Jan Lindström
87dc4e98dd MDEV-17276: Adjust Galera tests after Galera library 25.3.24 2018-09-23 13:53:57 +03:00
Jan Lindström
eefaf4fdc9 Adjust disabled Galera tests. 2018-09-23 13:26:25 +03:00
Jan Lindström
428669fa83 MDEV-15805: Test failure on galera.query_cache
Reset query cache after every test case and add wait after
load infile.
2018-09-23 13:26:10 +03:00
Sergei Golubchik
7aba6f8f88 fix galera_sst_rsync_data_dir again
(already fixed in 10.2. bad merge?)
2018-09-22 15:36:27 +02:00
Sergei Golubchik
e7d152293d MDEV-13089 identifier quoting in partitioning
cover ALTER TABLE
2018-09-21 20:22:14 +02:00
Sergei Golubchik
e4b466aa3d MDEV-16792 Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno or wrong result upon SHOW TABLE STATUS after adding partition under ANSI_QUOTES
if opening a table fails with a syntax error, the error shouldn't
be suppressed completely as if it didn't happen at all.
2018-09-21 19:56:55 +02:00
Alexander Barkov
80bcb05b24 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-09-21 08:37:42 +04:00
Vladislav Vaintroub
0fa35ddf1f Amend fix for MDEV-17236
Simplify, and make it work with system tablespace outside of
innodb data home.

Also, do not reread TRX_SYS page  in endless loop,
if it appears to be corrupted.

Use finite number of attempts.
2018-09-20 14:08:57 +01:00
Thirunarayanan Balathandayuthapani
7e4bbd3aa6 MDEV-17236 mariabackup incorrectly tries to open ibdata1
if custom undo tablespace is defined

- In case of multiple undo tablespace, mariabackup have to open system
tablespace to find the list of undo tablespace present in TRX_SYS page.
For opening system tablespace, mariabackup should fetch the file name
from already initialized system tablespace object.
2018-09-20 17:13:12 +05:30
Marko Mäkelä
90b292ce31 Follow-up to MDEV-16328: ALTER TABLE…page_compression_level should not rebuild table
Allow combination of non-instant, non-rebuilding operations with
changes of table options that do not require a rebuild.

For example, DROP INDEX or ADD INDEX can be performed with
ALGORITHM=NOCOPY together with changing such table options.
Changing the table options alone would be allowed with ALGORITHM=INSTANT.

INNOBASE_ALTER_NOCREATE: A new set of flags, for operations that
are refused for ALGORITHM=INSTANT and do not involve creating
index trees.

Move ALTER_RENAME_INDEX to the proper place (INNOBASE_ALTER_INSTANT).

innobase_need_rebuild(): Do not require a rebuild if
INNOBASE_ALTER_NOREBUILD operations are combined with ALTER_OPTIONS.

ha_innobase::prepare_inplace_alter_table(),
ha_innobase::inplace_alter_table(): Use the fast path if
ALTER_OPTIONS is combined with INNOBASE_ALTER_NOCREATE.
In this case, the actual changes would be deferred to
ha_innobase::commit_inplace_alter_table().
2018-09-19 17:29:25 +03:00
Jan Lindström
3177d26627 MDEV-13873: galera.galera_suspend_slave failed in buildbot with wrong error code
Add wsrep_sync_wait as we want INSERT to fail.
2018-09-19 13:10:54 +03:00
Jan Lindström
45712a9a1f MDEV-13871: galera.galera_unicode_identifiers failed in buildbot with 'Unknown database'
Wait in second node until tables with databases are created.
2018-09-19 12:19:30 +03:00