Commit graph

183894 commits

Author SHA1 Message Date
Julius Goryavsky
cadb6ac770 DEV-17835: Remove wsrep-sst-method=xtrabackup
The use of the xtrabackup and xtrabackup-v2 methods for SST
has been declared obsolete since version 10.2, now it cannot
be used because of the different redo log format. Accordingly,
we need to remove the xtrabackup-related scripts and dynamically
replace the call to xtrabackup[-v2] to the mariabackup (with a
corresponding warning in the log) when the server performs SST.

https://jira.mariadb.org/browse/MDEV-17835
2018-12-17 11:14:54 +01:00
Marko Mäkelä
b6f203984b Merge 10.2 into 10.3 2018-12-04 13:18:14 +02:00
Thirunarayanan Balathandayuthapani
157d3c3bc1 MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- Fixed innodb.table_flags test case in release build.
2018-12-03 15:57:21 +05:30
Thirunarayanan Balathandayuthapani
f2c7972a3d MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY
- This is a regression of commit b26e603aeb. While dropping
the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one.
2018-12-03 01:12:04 +05:30
Igor Babaev
46960365b1 MDEV-17871 Crash when running explain with CTE
When the with clause of a query contains a recursive CTE that is not used
then processing of EXPLAIN for this query does not require optimization
of the unit specifying this CTE. In this case if 'derived' is the
TABLE_LIST object created for this CTE then derived->derived_result is NULL
and any assignment to derived->derived_result->table causes a crash.
After fixing this problem in the code of st_select_lex_unit::prepare()
EXPLAIN for such a query worked without crashes. Yet an execution
plan for the recursive CTE appeared there. The cause of this problem was
an incorrect condition used in JOIN::save_explain_data_intern() that
determined whether CTE was to be optimized or not. A similar condition was
used in select_describe() and this patch has corrected it as well.
2018-12-01 15:06:04 -08:00
Marko Mäkelä
3e5162d814 Re-disable a failing test 2018-11-30 15:54:21 +02:00
Marko Mäkelä
95f3c142a4 MDEV-17881: Fix a debug assertion
In 10.3, rec_is_metadata() takes a pointer, while in 10.4 it
takes a reference as a parameter. I ported this patch from
10.4 to 10.3, and then only ran a release build, not debug build.
2018-11-30 15:48:33 +02:00
Marko Mäkelä
e46a3aa42e MDEV-17881 Assertion failure in cmp_dtuple_rec_with_match_bytes after instant ADD COLUMN
The special flag REC_INFO_MIN_REC_FLAG used to be only set on the
first record in the leftmost node pointer page of each level of the tree.
It was never set on leaf pages.

MDEV-11369 Instant ADD COLUMN in MariaDB Server 10.3 repurposed the flag
to identify a hidden metadata record, which is stored in the first record
on the leftmost leaf page.

If the adaptive hash index points to records in the leftmost leaf page
after instant ALTER TABLE, we would have such a metadata record in the
table, an assertion could fail when trying to validate the index record.
In a release build, we might wrongly qualify the hidden metadata record
and thus return garbage results.

cmp_dtuple_rec_with_match_bytes(): If the REC_INFO_MIN_REC_FLAG is
set on the record, assert that this is the first record on the
leftmost page and that the record is a metadata record, and finally
return 1, because by definition, anything is greater than the
minimum record.
2018-11-30 12:40:03 +02:00
Marko Mäkelä
0abd2766b1 Merge 10.2 into 10.3
Also, related to MDEV-15522, MDEV-17304, MDEV-17835,
remove the Galera xtrabackup tests, because xtrabackup never worked
with MariaDB Server 10.3 due to InnoDB redo log format changes.
2018-11-30 09:38:56 +02:00
Jan Lindström
7826b9b983 Fix syntax error on galera/disabled.def file 2018-11-29 17:11:19 +02:00
Jan Lindström
33fdb443ea Fix xtrabackup SST tests by using innodb-safe-truncate=OFF.
Disable tests that do not yet pass.
2018-11-29 17:11:19 +02:00
Jan Lindström
b4d102e828 MDEV-17810: Improve error printout when decryption fails or we identify page as both encrypted and unencrypted
fil_space_verify_crypt_checksum
	Print out both stored checksum and calculated checksums
	for encrypted page and unencrypted page asumptions.
2018-11-29 17:11:19 +02:00
Marko Mäkelä
447e493179 Remove some unnecessary InnoDB #include 2018-11-29 12:53:44 +02:00
Marko Mäkelä
be998bfdc5 MDEV-17859: Clean up the FOREIGN KEY handling
dict_create_add_foreigns_to_dictionary(): Do not commit the transaction.
The operation can still fail in dict_load_foreigns(), and we want
to be able to roll back the transaction.

create_table_info_t::create_table(): Never reset m_drop_before_rollback,
and never commit the transaction. We use a single point of rollback
in ha_innobase::create(). Merge the logic from
row_table_add_foreign_constraints().
2018-11-29 09:16:48 +02:00
Marko Mäkelä
35184902db Merge 10.2 into 10.3 2018-11-28 15:23:23 +02:00
Marko Mäkelä
b26e603aeb MDEV-17859 Operating system errors in file operations after failed CREATE
This is a regression due to MDEV-17816.

When creating a table fails, we must roll back the dictionary
transaction. Because the rollback may rename tables, and because
InnoDB lacks proper undo logging for CREATE operations, we must
drop the incompletely created table before rolling back the
transaction, which could include a RENAME operation.
But, we must not blindly drop the table by name; after all,
the operation could have failed because another table by the
same name already existed.

create_table_info_t::m_drop_before_rollback: A flag that is set
if the table needs to be dropped before transaction rollback.

create_table_info_t::create_table(): Remove some duplicated
error handling.

ha_innobase::create(): On error, only drop the table if it was
actually created.
2018-11-28 15:17:56 +02:00
Sergei Petrunia
0485e51935 MDEV-13155: XA recovery not supported for RocksDB
Added a testcase
2018-11-28 12:39:36 +03:00
Marko Mäkelä
babb000a36 Merge 10.2 into 10.3 2018-11-28 01:02:46 +02:00
Marko Mäkelä
4a92165ff0 Remove unused mem_heap_allocator
The code became unused in commit 10590dd39c.
2018-11-28 00:52:30 +02:00
Jan Lindström
4b88d5ee51 MDEV-17771: Add Galera ist and sst tests using mariabackup
Add check that file key management plugin is found.
2018-11-27 15:26:18 +02:00
Marko Mäkelä
e82e216e37 MDEV-17849 Undo tablespace truncation recovery fails to shrink file
fil_space_t::add(): Replaces fil_node_create(), fil_node_create_low().
Let the caller pass fil_node_t::handle, to avoid having to close and
re-open files.

fil_node_t::read_page0(): Refactored from fil_node_open_file().
Read the first page of a data file.

fil_node_open_file(): Open the file only once.

srv_undo_tablespace_open(): Set the file handle for the opened
undo tablespace. This should ensure that ut_ad(file->is_open())
no longer fails in recv_add_trim().

xtrabackup_backup_func(): Remove some dead code.

xb_fil_cur_open(): Open files only if needed. Undo tablespaces
should already have been opened.
2018-11-27 14:49:39 +02:00
Marko Mäkelä
eb6364619f Remove the redundant variable fil_n_file_opened 2018-11-27 14:30:39 +02:00
Marko Mäkelä
b9824074a6 MDEV-17851 Assertion failure srv_undo_tablespaces > 1
trx_assign_rseg_low(): Skip dedicated undo tablespaces if
innodb_undo_tablespaces=0 has been set after the database was created.
2018-11-27 14:02:24 +02:00
Marko Mäkelä
861038f2e8 MDEV-17816: Follow-up fix
When dropping a partially created table due to failure,
use SQLCOM_TRUNCATE instead of SQLCOM_DROP_DB, so that
no foreign key constraints will be touched. If any
constraints were added as part of the creation, they would
be reverted as part of the transaction rollback.

We need an explicit call to row_drop_table_for_mysql(),
because InnoDB does not do proper undo logging for CREATE TABLE,
but would only drop the table at the end of the rollback.
This would not work if the transaction combines both
RENAME and CREATE, like TRUNCATE now does.
2018-11-26 17:32:57 +02:00
Marko Mäkelä
36359157cf Merge 10.2 into 10.3 2018-11-26 16:49:26 +02:00
Marko Mäkelä
971e1d8677 MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
If a table had a KEY_BLOCK_SIZE attribute, but no ROW_FORMAT,
it would be created as ROW_FORMAT=COMPRESSED in InnoDB.
However, TRUNCATE TABLE would lose the KEY_BLOCK_SIZE attribute
and create the table with the innodb_default_row_format (DYNAMIC).

This is a regression that was introduced by MDEV-13564.

update_create_info_from_table(): Copy also KEY_BLOCK_SIZE.
2018-11-26 16:41:09 +02:00
Marko Mäkelä
1afed20774 Merge 10.2 into 10.3
The test galera_sst_mariabackup_table_options was disabled,
because the server refuses to start up due to wrong parameters.
2018-11-26 14:05:15 +02:00
Jan Lindström
9669536c23 MDEV-17811: Add deprecation information for xtrabackup 2018-11-26 12:58:42 +02:00
Marko Mäkelä
2a31b82831 MDEV-17816 Crash in TRUNCATE TABLE when table creation fails
The error handling in the MDEV-13564 TRUNCATE TABLE was broken
when an error occurred during table creation.

row_create_index_for_mysql(): Do not drop the table on error.

fts_create_one_common_table(), fts_create_one_index_table():
Do drop the table on error.

create_index(), create_table_info_t::create_table():
Let the caller handle the index creation errors.

ha_innobase::create(): If create_table_info_t::create_table()
fails, drop the incomplete table, roll back the transaction,
and finally return an error to the caller.
2018-11-26 12:50:27 +02:00
Daniel Black
06972b2fbc travis: xcode10.1 2018-11-26 14:34:19 +04:00
Marko Mäkelä
a81fceafb1 MDEV-14409 Assertion `page_rec_is_leaf(rec)' failed in lock_rec_validate_page
lock_rec_queue_validate(): Assert page_rec_is_leaf(rec), except when
the record is a page infimum or supremum.

lock_rec_validate_page(): Relax the assertion that failed.
The assertion was reachable when the record lock bitmap was empty.

lock_rec_insert_check_and_lock(): Assert page_is_leaf().
2018-11-26 10:10:49 +02:00
Marko Mäkelä
06e5f28f9f MDEV-12266: Remove a level of pointer indirection
Replace table->space->id with table->space_id.
2018-11-22 17:10:26 +02:00
Jan Lindström
3728b11f87 MDEV-17804: Galera tests cause mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
Do not do end of statement logic if thd is already killed as
socket is already closed.
2018-11-22 16:36:16 +02:00
Jan Lindström
dde0a83fff MDEV-17801: Galera test failure on galera_var_reject_queries
Problem was that controlling connection i.e. connection that
executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL;
was also killed but server would try to send result from that
query to controlling connection resulting a assertion
mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
as socket was closed when controlling connection was closed.

wsrep_close_client_connections()
	Do not close controlling connection and instead of
	wsrep_close_thread() we do now soft kill by THD::awake

wsrep_reject_queries_update()
	Call wsrep_close_client_connections using current thd.
2018-11-22 16:36:16 +02:00
Jan Lindström
2b49e15686 MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup
Disable galera_3nodes tests using xtrabackup.
2018-11-22 16:36:16 +02:00
Jan Lindström
00c88a7122 MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup
Disable galera tests using xtrabackup.
2018-11-22 16:36:16 +02:00
Jan Lindström
4b1b4b3920 MDEV-17771: Add Galera ist and sst tests using mariabackup
Record result files for 10.2.
2018-11-22 16:36:09 +02:00
Jan Lindström
06063e8a41 Merge remote-tracking branch 'origin/10.1' into 10.2 2018-11-21 16:59:11 +02:00
Monty
0c69f2e1ee Fixed compiler warnings 2018-11-21 16:57:18 +02:00
Jan Lindström
8324e5e84d MDEV-17771: Add Galera ist and sst tests using mariabackup
Add test case for encrypted and page compressed tables.
2018-11-21 09:05:47 +02:00
Oleksandr Byelkin
d07a6e33dd Check that default() do not see invisible field. 2018-11-20 17:31:07 +01:00
Daniel Bartholomew
02b70702d9 bump the VERSION 2018-11-20 09:04:11 -05:00
Marko Mäkelä
4210e7bf6f Merge 10.2 into 10.3 2018-11-20 15:08:41 +02:00
Marko Mäkelä
92996c9aa9 Merge bb-10.3-release into 10.3 2018-11-20 15:08:30 +02:00
Marko Mäkelä
b86e18cb44 MDEV-17780 innodb.truncate_recover crashes in recovery due to out-of-bounds page read
recv_addr_trim(): Do not try to detach the hash bucket, because
the code for doing that does not always work.

recv_apply_hashed_log_recs(): Do not attempt to read pages for which
there exist no redo log records.
2018-11-20 14:55:44 +02:00
Jan Lindström
41fa9a5986 Add missing .rdiff file to test galera_sst_xtrabackup-v2_data_dir
for debug build.
2018-11-20 07:49:46 +02:00
Elena Stepanova
ae96b47f9e MDEV-17507 Make MTR tests work for builds without Aria for temporary tables
Skip tests which expectedly fail when Aria is not used for temporary tables
2018-11-20 01:50:59 +02:00
Marko Mäkelä
fd58bb71e2 Merge 10.2 into 10.3 2018-11-19 18:45:53 +02:00
Jan Lindström
6fad15d02a MDEV-17771: Add Galera ist and sst tests using mariabackup
Remove unnecessary have_debug requirement, record results using
release build and create .rdiff file for debug builds where
needed.
2018-11-19 17:34:22 +02:00
zdrav1
ea03eac5d7 fiexed debug build failure of galera_ist_mariabackup_innodb_flush_logs 2018-11-19 15:06:34 +02:00