Commit graph

1648 commits

Author SHA1 Message Date
Marko Mäkelä
3c4cff3357 Merge 10.1 into 10.2 2017-10-02 11:16:53 +03:00
Marko Mäkelä
ac0b5a2e79 Merge 10.0 into 10.1 2017-10-02 10:45:55 +03:00
Marko Mäkelä
de4a00d4f7 Merge 5.5 into 10.0 2017-10-02 10:42:55 +03:00
Marko Mäkelä
028d253dd7 MDEV-13980 InnoDB fails to discard record lock when discarding an index page
btr_cur_pessimistic_delete(): Discard a possible record lock also in
the case when the record was the only one in the page. Failure to
do this would corrupt the record lock data structures in a partial
rollback (ROLLBACK TO SAVEPOINT or rolling back a row operation due
to some error, such as a duplicate key in a unique secondary index).
2017-10-02 10:38:35 +03:00
Jan Lindström
b8488e5cf5 MDEV-13932: fil0pagecompress.cc fails to compile with lzo 2.10
Patch contibuted by Gordon Fisher. Thank you for your contribution!
2017-09-29 14:14:22 +03:00
Jan Lindström
4d01dd79a1 MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes written to temporary file
After review cleanup.
2017-09-28 12:38:51 +03:00
Sergei Golubchik
f7628ca3c2 cleanup: remove useless "inline" keywords
avoid a function call for a commonly used one-liner.
followup for 0627929f62
2017-09-27 10:22:14 +02:00
Sachin Setiya
0627929f62 MDEV-13787 Crash in persistent stats wsrep_on (thd=0x0)
Problem:- This crash happens because of thd = NULL , and while checking
for wsrep_on , we no longer check for thd != NULL (MDEV-7955). So this
problem is regression of MDEV-7955. However this patch not only solves
this regression , It solves all regression caused by MDEV-7955 patch.

To get all possible cases when thd can be null , assert(thd)/
assert(trx->mysql_thd) is place just before all wsrep_on and innodb test
suite is run. And the assert which caused failure are removed with a physical
check for thd != NULL. Rest assert are removed. Hopefully this method will
remove all current/potential regression of MDEV-7955.
2017-09-27 10:15:08 +05:30
Marko Mäkelä
7dcb8816a1 Merge 10.1 into 10.2 2017-09-25 13:46:54 +03:00
Marko Mäkelä
84be33abe0 Merge 10.0 into 10.1 2017-09-25 09:50:24 +03:00
Marko Mäkelä
78b63425a3 MDEV-13899 IMPORT TABLESPACE may corrupt ROW_FORMAT=REDUNDANT tables
The ALTER TABLE…IMPORT TABLESPACE adjustment code that was introduced by
WL#5522 in MySQL 5.6 is incorrectly invoking rec_get_status() on a
ROW_FORMAT=REDUNDANT record to determine if a record is a leaf page record.
The function rec_get_status(rec) is only to be called on
ROW_FORMAT=COMPACT, DYNAMIC or COMPRESSED records.
2017-09-24 10:11:16 +03:00
Marko Mäkelä
e0ebe3d083 Merge 10.0 into 10.1 2017-09-22 10:31:49 +03:00
Marko Mäkelä
f6cb4f0a19 MDEV-13814 Extra logging when innodb_log_archive=ON
log_group_read_log_seg(): Only display the message during recovery,
not during normal operation. When the XtraDB configuration parameter
innodb_log_archive is set, this function will be called during
normal operation.
2017-09-22 10:28:14 +03:00
Vicențiu Ciorbaru
22c322c649 Merge branch '10.1' into 10.2 2017-09-19 12:43:02 +03:00
Vicențiu Ciorbaru
ec6042bda0 Merge branch '10.0' into 10.1 2017-09-19 12:06:50 +03:00
Vicențiu Ciorbaru
b337a06829 Revert d9bc5e03d788b958ce8c76e157239953db60adb2 from Oracle (in XtraDB) 2017-09-19 11:53:59 +03:00
Vicențiu Ciorbaru
dab6f56098 Revert Bug #25175249 ASSERTION: (TEMPL->IS_VIRTUAL && !FIELD) || (FIELD && FIELD->PREFIX_LEN ? FIELD
We don't want this in innodb/xtradb
2017-09-19 11:46:38 +03:00
Vicențiu Ciorbaru
cbd62feee5 Merge branch 'merge-xtradb-5.6' into 10.0 2017-09-19 11:35:09 +03:00
Vicențiu Ciorbaru
b4606367d7 5.6.37-82.2 2017-09-19 00:44:27 +03:00
Vicențiu Ciorbaru
e7bb818116 Merge remote-tracking branch 'merge/merge-xtradb-5.5' into 5.5 2017-09-19 00:31:15 +03:00
Vicențiu Ciorbaru
f534eef794 5.5.57-38.9 2017-09-19 00:25:34 +03:00
Marko Mäkelä
d9277732d7 Merge 10.1 into 10.2
This should also fix the MariaDB 10.2.2 bug
MDEV-13826 CREATE FULLTEXT INDEX on encrypted table fails.

MDEV-12634 FIXME: Modify innodb-index-online, innodb-table-online
so that they will write and read merge sort files. InnoDB 5.7
introduced some optimizations to avoid using the files for small tables.

Many collation test results have been adjusted for MDEV-10191.
2017-09-17 11:05:33 +03:00
Marko Mäkelä
836d4e74d9 Write proper tests for MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes
Introduce innodb_encrypt_log.combinations and prove that
the encryption and decryption take place during both
online ADD INDEX (WL#5266) and online table-rebuilding ALTER (WL#6625).
2017-09-16 21:15:38 +03:00
Marko Mäkelä
75dd3bcb4c Clean up after commit 93087d5fe7
Apply the same changes to both InnoDB and XtraDB.
2017-09-16 15:05:22 +03:00
Vladislav Vaintroub
1d7bc3b582 Innodb : do not call fflush() in os_get_last_error_low(), if no error
message was written.
2017-09-16 09:45:38 +00:00
Vladislav Vaintroub
ad17e8e518 MDEV-13821 : mariabackup sometimes could lose ib_logf(FATAL) messages,
The messages are getting lost because they are written with fprintf()
but without fflush(), so abort() would lose buffered text.

Applied fix from 10.2, which makes in_logf() use
sql_print_information(), which in turn does proper flush after each message
2017-09-16 09:45:38 +00:00
Vladislav Vaintroub
93087d5fe7 Fix some warnings 2017-09-16 09:45:38 +00:00
Marko Mäkelä
8c4df595b8 MDEV-13807 mariabackup --apply-log-only does generate redo log by performing rollback and possibly other tasks
Skip rollback and other redo-log-generating tasks if
srv_apply_log_only is set.

Instead of assigning the debug variable recv_no_log_write = FALSE,
assign it to srv_apply_log_only, so that any unwanted writes are caught.
2017-09-16 09:55:49 +03:00
Vladislav Vaintroub
a73b55a9f8 Windows : fix a warning in popular header file 2017-09-15 16:20:38 +00:00
Jan Lindström
fa2701c6f7 MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes written to tem…
…porary file

Fixed by removing writing key version to start of every block that
was encrypted. Instead we will use single key version from log_sys
crypt info.

After this MDEV also blocks writen to row log are encrypted and blocks
read from row log aren decrypted if encryption is configured for the
table.

innodb_status_variables[], struct srv_stats_t
	Added status variables for merge block and row log block
	encryption and decryption amounts.

Removed ROW_MERGE_RESERVE_SIZE define.

row_merge_fts_doc_tokenize
	Remove ROW_MERGE_RESERVE_SIZE

row_log_t
	Add index, crypt_tail, crypt_head to be used in case of
	encryption.

row_log_online_op, row_log_table_close_func
	Before writing a block encrypt it if encryption is enabled

row_log_table_apply_ops, row_log_apply_ops
	After reading a block decrypt it if encryption is enabled

row_log_allocate
	Allocate temporary buffers crypt_head and crypt_tail
	if needed.

row_log_free
	Free temporary buffers crypt_head and crypt_tail if they
	exist.

row_merge_encrypt_buf, row_merge_decrypt_buf
	Removed.

row_merge_buf_create, row_merge_buf_write
	Remove ROW_MERGE_RESERVE_SIZE

row_merge_build_indexes
	Allocate temporary buffer used in decryption and encryption
	if needed.

log_tmp_blocks_crypt, log_tmp_block_encrypt, log_temp_block_decrypt
	New functions used in block encryption and decryption

log_tmp_is_encrypted
	New function to check is encryption enabled.

Added test case innodb-rowlog to force creating a row log and
verify that operations are done using introduced status
variables.
2017-09-14 09:23:20 +03:00
Marko Mäkelä
d26fb96a9f Merge 10.1 into 10.2 2017-09-07 12:12:31 +03:00
Marko Mäkelä
112d721a74 Merge 10.0 into 10.1 2017-09-07 12:08:34 +03:00
Marko Mäkelä
d861822c4f MDEV-13253 After rebuilding redo logs, InnoDB can leak data from redo log buffer
recv_reset_logs(): Initialize the redo log buffer, so that no data
from the old redo log can be written to the new redo log.

This bug has very little impact before MariaDB 10.2. The
innodb_log_encrypt option that was introduced in MariaDB 10.1
increases the impact. If the redo log used to be encrypted, and
it is being resized and encryption disabled, then previously
encrypted data could end up being written to the new redo log
in clear text. This resulted in encryption.innodb_encrypt_log
test failures in MariaDB 10.2.
2017-09-07 12:01:07 +03:00
Marko Mäkelä
3ec8268b4a Follow-up to MDEV-13103: Do not add __attribute__((nonnull))
In XtraDB, buf_block_get_frame() can return NULL, and this value
can be passed to buf_page_print(). Do not declare the parameter
as nonnull.
2017-09-07 11:58:21 +03:00
Marko Mäkelä
70db1e3b8a Merge 10.1 into 10.2 2017-09-06 19:28:51 +03:00
Marko Mäkelä
cd694d76ce Merge 10.0 into 10.1 2017-09-06 15:32:56 +03:00
Marko Mäkelä
6b45355e6b MDEV-13103 Assertion `flags & BUF_PAGE_PRINT_NO_CRASH' failed in buf_page_print
buf_page_print(): Remove the parameter 'flags',
and when a server abort is intended, perform that in the caller.

In this way, page corruption reports due to different reasons
can be distinguished better.

This is non-functional code refactoring that does not fix any
page corruption issues. The change is only made to avoid falsely
grouping together unrelated causes of page corruption.
2017-09-06 14:01:15 +03:00
Marko Mäkelä
7f99381288 Fix compiler warnings
metadata_lock_info_duration[]: Remove the unused variable.

Add some comments /* fall through */ to silence -Wimplicit-fallthrough
2017-09-01 15:40:49 +03:00
Marko Mäkelä
2000a9009b Merge 10.1 into 10.2 2017-08-31 11:14:28 +03:00
Marko Mäkelä
38ca9be4de MDEV-13684 InnoDB race condition between fil_crypt_thread and btr_scrub_init
There is a race condition in InnoDB startup. A number of
fil_crypt_thread are created by fil_crypt_threads_init(). These threads
may call btr_scrub_complete_space() before btr_scrub_init() was called.
Those too early calls would be accessing an uninitialized scrub_stat_mutex.

innobase_start_or_create_for_mysql(): Invoke btr_scrub_init() before
fil_crypt_threads_init().

fil_crypt_complete_rotate_space(): Only invoke btr_scrub_complete_space()
if scrubbing is enabled. There is no need to update the statistics if
it is not enabled.
2017-08-31 11:08:43 +03:00
Marko Mäkelä
a36c369bda Merge 10.1 into 10.2
For running the Galera tests, the variable my_disable_leak_check
was set to true in order to avoid assertions due to memory leaks
at shutdown.

Some adjustments due to MDEV-13625 (merge InnoDB tests from MySQL 5.6)
were performed. The most notable behaviour changes from 10.0 and 10.1
are the following:

* innodb.innodb-table-online: adjustments for the DROP COLUMN
behaviour change (MDEV-11114, MDEV-13613)

* innodb.innodb-index-online-fk: the removal of a (1,NULL) record
from the result; originally removed in MySQL 5.7 in the
Oracle Bug #16244691 fix
377774689b

* innodb.create-index-debug: disabled due to MDEV-13680
(the MySQL Bug #77497 fix was not merged from 5.6 to 5.7.10)

* innodb.innodb-alter-autoinc: MariaDB 10.2 behaves like MySQL 5.6/5.7,
while MariaDB 10.0 and 10.1 assign different values when
auto_increment_increment or auto_increment_offset are used.
Also MySQL 5.6/5.7 exhibit different behaviour between
LGORITHM=INPLACE and ALGORITHM=COPY, so something needs to be tested
and fixed in both MariaDB 10.0 and 10.2.

* innodb.innodb-wl5980-alter: disabled because it would trigger an
InnoDB assertion failure (MDEV-13668 may need additional effort in 10.2)
2017-08-31 09:30:40 +03:00
Jan Lindström
b29f26d774 Fix test failures on embedded server.
Problem was incorrect definition of wsrep_recovery,
trx_sys_update_wsrep_checkpoint and
trx_sys_read_wsrep_checkpoint functions causing
innodb_plugin not to load as there was undefined symbols.
2017-08-31 08:38:26 +03:00
Marko Mäkelä
829752973b Merge branch '10.0' into 10.1 2017-08-30 13:06:13 +03:00
Marko Mäkelä
4c91fd4cd6 Galera after-merge fixes
wsrep_drop_table_query(): Remove the definition of this ununsed function.

row_upd_sec_index_entry(), row_upd_clust_rec_by_insert():
Evaluate the simplest conditions first. The merge could have slightly
hurt performance by causing extra calls to wsrep_on().
2017-08-30 12:29:47 +03:00
Marko Mäkelä
e634fdcd5b WL#8845: Clarify the message about redo log format incompatibility
recv_find_max_checkpoint(): Refer to MariaDB 10.2.2 instead of
MySQL 5.7.9. Do not hint that a binary downgrade might be possible,
because there are many changes in InnoDB 5.7 that could make
downgrade impossible: a column appended to SYS_INDEXES, added
SYS_* tables, undo log format changes, and so on.
2017-08-29 21:58:02 +03:00
Jan Lindström
01209de763 Merge remote-tracking branch 'origin/bb-10.1-jplindst' into 10.1 2017-08-29 20:30:18 +03:00
Jan Lindström
352d27ce36 MDEV-13557: Startup failure, unable to decrypt ibdata1
Fixes also MDEV-13488: InnoDB writes CRYPT_INFO even though
encryption is not enabled.

Problem was that we created encryption metadata (crypt_data) for
system tablespace even when no encryption was enabled and too early.
System tablespace can be encrypted only using key rotation.

Test innodb-key-rotation-disable, innodb_encryption, innodb_lotoftables
require adjustment because INFORMATION_SCHEMA INNODB_TABLESPACES_ENCRYPTION
contain row only if tablespace really has encryption metadata.

fil_crypt_set_thread_cnt: Send message to background encryption threads
if they exits when they are ready. This is required to find tablespaces
requiring key rotation if no other changes happen.

fil_crypt_find_space_to_rotate: Decrease the amount of time waiting
when nothing happens to better enable key rotation on startup.

fsp_header_init: Write encryption metadata to page 0 only if tablespace is
encrypted or encryption is disabled by table option.

i_s_dict_fill_tablespaces_encryption : Skip tablespaces that do not
contain encryption metadata. This is required to avoid too early
wait condition trigger in encrypted -> unencrypted state transfer.

open_or_create_data_files: Do not create encryption metadata
by default to system tablespace.
2017-08-29 14:23:34 +03:00
Andrei Elkin
888a8b69bd MDEV-13437 InnoDB fails to return error for XA COMMIT or XA ROLLBACK in read-only mode
Assertions failed due to incorrect handling of the --tc-heuristic-recover
option when InnoDB is in read-only mode either due to innodb_read_only=1
or innodb_force_recovery>3. InnoDB failed to refuse a XA COMMIT or
XA ROLLBACK operation, and there were errors in the error handling in
the upper layer.

This was fixed by making InnoDB XA operations respect the
high_level_read_only flag. The InnoDB part of the fix and
parts of the test main.tc_heuristic_recover were provided
by Marko Mäkelä.

LOCK_log mutex lock/unlock had to be added to fix MDEV-13438.
The measure is confirmed by mysql sources as well.

For testing of the conflicting option combination, mysql-test-run is
made to export a new $MYSQLD_LAST_CMD. It holds the very last value
generated by mtr.mysqld_start().  Even though the options have been
also always stored in $mysqld->{'started_opts'} there were no access
to them beyond the automatic server restart by mtr through the expect
file interface.

Effectively therefore $MYSQLD_LAST_CMD represents a more general
interface to $mysqld->{'started_opts'} which can be used in wider
scopes including server launch with incompatible options.

Notice another existing method to restart the server with incompatible
options relying on $MYSQLD_CMD is is aware of $mysqld->{'started_opts'}
(the actual options that the server is launched by mtr). In order to use
this method they would have to be provided manually.

NOTE: When merging to 10.2, the file search_pattern_in_file++.inc
should be replaced with the pre-existing search_pattern_in_file.inc.
2017-08-29 11:59:59 +03:00
Marko Mäkelä
f192b48d62 Merge 10.1 into 10.2 2017-08-29 10:07:33 +03:00
Marko Mäkelä
11352d52cd Merge 10.0 into 10.1 2017-08-28 15:05:46 +03:00