Commit graph

177698 commits

Author SHA1 Message Date
Marko Mäkelä
fbeb9489cd Cleanup of MDEV-12600: crash during install_db with innodb_page_size=32K and ibdata1=3M
The doublewrite buffer pages must fit in the first InnoDB system
tablespace data file. The checks that were added in the initial patch
(commit 112b21da37)
were at too high level and did not cover all cases.

innodb.log_data_file_size: Test all innodb_page_size combinations.

fsp_header_init(): Never return an error. Move the change buffer creation
to the only caller that needs to do it.

btr_create(): Clean up the logic. Remove the error log messages.

buf_dblwr_create(): Try to return an error on non-fatal failure.
Check that the first data file is big enough for creating the
doublewrite buffers.

buf_dblwr_process(): Check if the doublewrite buffer is available.
Display the message only if it is available.

recv_recovery_from_checkpoint_start_func(): Remove a redundant message
about FIL_PAGE_FILE_FLUSH_LSN mismatch when crash recovery has already
been initiated.

fil_report_invalid_page_access(): Simplify the message.

fseg_create_general(): Do not emit messages to the error log.

innobase_init(): Revert the changes.

trx_rseg_create(): Refactor (no functional change).
2017-06-08 11:55:47 +03:00
Jan Lindström
d03abc71a4 MDEV-12609: Allow suppression of InnoDB log messages about reserving extents
Removed this output.
2017-06-08 10:34:10 +03:00
Daniel Black
c4cbc7a880 travis: allowed_failures MYSQL_TEST_SUITES=plugins (MDEV-13002) 2017-06-08 10:53:12 +04:00
Daniel Black
798db3d710 travis: allow_failures os: osx
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-06-08 10:53:12 +04:00
Daniel Black
035f74c36c travis: enable (main,archive).mysqlhotcopy_\1 test 2017-06-08 10:51:52 +04:00
Marko Mäkelä
68890fe7d4 Revert part of MDEV-12113
commit 1af8bf39ca added unnecessary
calls to fil_write_flushed_lsn() during redo log resizing at
InnoDB server startup.

Because fil_write_flushed_lsn() is neither redo-logged nor doublewrite
buffered, the call is risky and should be avoided, because if the
server killed during the write call, the whole InnoDB instance can
become inaccessible (corrupted page 0 in the system tablespace).

In the best case, this call might prevent a diagnostic message from
being emitted to the error log on the next startup.
2017-06-08 09:04:28 +03:00
Jan Lindström
18f62d94d6 Merge pull request #404 from grooverdan/10.1-MDEV-13032-galera_new_cluster
MDEV-13032: fix galera_new_cluster to be POSIX
2017-06-08 08:18:38 +03:00
Daniel Black
d8515829ec MDEV-13032: fix galera_new_cluster to be POSIX
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-06-08 12:43:39 +10:00
Marko Mäkelä
6439238c53 Correct a merge error 2017-06-06 14:57:20 +03:00
Marko Mäkelä
bb1f41423a InnoDB: Remove thread_mutex
Use my_atomic for updating os_thread_count.

os_thread_init(): Remove.
2017-06-06 12:09:49 +03:00
Marko Mäkelä
86927cc712 Remove traces of multiple InnoDB redo logs
InnoDB never supported more than one copy of a redo log.
There were provisions to do that. For Mariabackup, let us clean up
this code.

log_sys_init(): Renamed from log_init().

log_set_capacity(): Renamed from log_calc_max_ages().

log_init(): Renamed from log_group_init(). Remove the parameters
id, space_id. Let the caller invoke log_set_capacity() when needed.

log_group_t: Remove id, space_id, log_groups.

log_t: Replace log_groups with a single log.

recv_find_max_checkpoint(): Declare globally. Remove the first parameter.

xtrabackup_choose_lsn_offset(): Remove (dead code).
2017-06-06 12:06:41 +03:00
Marko Mäkelä
ed2976caf0 Remove an orphan declaration lock_rec_enqueue_waiting()
MySQL WL#6835 replaced the function lock_rec_enqueue_waiting()
with RecLock::enqueue() and later RecLock::add_to_waitq().
2017-06-06 12:05:28 +03:00
Marko Mäkelä
da9c30a7b0 Remove unused declarations 2017-06-06 12:04:58 +03:00
Marko Mäkelä
6e0e5eefbc Fix some printf format type mismatch 2017-06-06 12:04:29 +03:00
Daniel Black
22fa9f22aa travis: add uuid-dev as dependency 2017-06-06 12:36:53 +04:00
Marko Mäkelä
30df297c2f Merge 10.0 into 10.1
Rewrite the test encryption.innodb-checksum-algorithm not to
require any restarts or re-bootstrapping, and to cover all
innodb_page_size combinations.

Test innodb.101_compatibility with all innodb_page_size combinations.
2017-06-06 10:59:54 +03:00
Marko Mäkelä
d8d39721df Follow-up to MDEV-12042 (test innodb_page_size variants)
innodb_page_size_small: A new set of combinations, for
innodb_page_size up to 16k. In MariaDB 10.0, this does not
make a difference, but in 10.1 and later, innodb_page_size
would cover 32k and 64k, for which ROW_FORMAT=COMPRESSED
is not available.

Enable these combinations in a few InnoDB tests.
2017-06-06 09:34:09 +03:00
Marko Mäkelä
151daaf480 MDEV-12994 innodb_fast_shutdown=0 skips change buffer merge; fast shutdown does it
srv_master_thread(): Pass the correct parameter to srv_shutdown().
This bug was introduced in MDEV-12052, and it affects the MariaDB 10.1.24
release.
2017-06-05 15:16:15 +03:00
Sachin Setiya
da61107fc8 MDEV-9544 FLUSH [RELAY] LOGS does not rotate logs for a named slave
Problem:- In the case of multisource replication/named slave
when we run "FLUSH LOGS" , it does not flush logs.

Solution:- A new function Master_info_index->flush_all_relay_logs()
is created which will rotate relay logs for all named slave.
This will be called in reload_acl_and_cache function when
connection_name.length == 0
2017-06-05 13:11:10 +05:30
Elena Stepanova
cc7e349012 MDEV-12764 main.log_tables-big fails in buildbot due to connect_log
Additionally internal check was failing because the test did not
restore a global value properly
2017-06-03 02:48:47 +03:00
Elena Stepanova
36e020a5d6 Adjust storage_engine suite according to server changes in 10.2 2017-06-03 02:47:52 +03:00
Elena Stepanova
ab62b7538f MDEV-12042 Re-bootstrap the server if InnoDB options are incompatible 2017-06-02 01:46:25 +03:00
Jan Lindström
aad8cefd2d Enable innodb_encryption-page-compression test. 2017-06-01 14:08:41 +03:00
Jan Lindström
112b21da37 MDEV-12600: crash during install_db with innodb_page_size=32K and ibdata1=3M;
Problem was that all doublewrite buffer pages must fit to first
system datafile.

Ported commit 27a34df7882b1f8ed283f22bf83e8bfc523cbfde
Author: Shaohua Wang <shaohua.wang@oracle.com>
Date:   Wed Aug 12 15:55:19 2015 +0800

    BUG#21551464 - SEGFAULT WHILE INITIALIZING DATABASE WHEN
    INNODB_DATA_FILE SIZE IS SMALL

To 10.1 (with extended error printout).

btr_create(): If ibuf header page allocation fails report error and
return FIL_NULL. Similarly if root page allocation fails return a error.

dict_build_table_def_step: If fsp_header_init fails return
error code.

fsp_header_init: returns true if header initialization succeeds
and false if not.

fseg_create_general: report error if segment or page allocation fails.

innobase_init: If first datafile is smaller than 3M and could not
contain all doublewrite buffer pages report error and fail to
initialize InnoDB plugin.

row_truncate_table_for_mysql: report error if fsp header init
fails.

srv_init_abort: New function to report database initialization errors.

srv_undo_tablespaces_init, innobase_start_or_create_for_mysql: If
database initialization fails report error and abort.

trx_rseg_create: If segment header creation fails return.
2017-06-01 14:07:48 +03:00
Jan Lindström
6b6987154a MDEV-12114: install_db shows corruption for rest encryption and innodb_checksum_algorithm=strict_none
Problem was that checksum check resulted false positives that page is
both not encrypted and encryted when checksum_algorithm was
strict_none.

Encrypton checksum will use only crc32 regardless of setting.

buf_zip_decompress: If compression fails report a error message
containing the space name if available (not available during import).
And note if space could be encrypted.

buf_page_get_gen: Do not assert if decompression fails,
instead unfix the page and return NULL to upper layer.

fil_crypt_calculate_checksum: Use only crc32 method.

fil_space_verify_crypt_checksum: Here we need to check
crc32, innodb and none method for old datafiles.

fil_space_release_for_io: Allow null space.

encryption.innodb-compressed-blob is now run with crc32 and none
combinations.

Note that with none and strict_none method there is not really
a way to detect page corruptions and page corruptions after
decrypting the page with incorrect key.

New test innodb-checksum-algorithm to test different checksum
algorithms with encrypted, row compressed and page compressed
tables.
2017-06-01 14:07:48 +03:00
Jan Lindström
1af8bf39ca MDEV-12113: install_db shows corruption for rest encryption with innodb_data_file_path=ibdata1:3M;
Problem was that FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION field that for
encrypted pages even in system datafiles should contain key_version
except very first page (0:0) is after encryption overwritten with
flush lsn.

Ported WL#7990 Repurpose FIL_PAGE_FLUSH_LSN to 10.1
The field FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION is consulted during
InnoDB startup.

At startup, InnoDB reads the FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION
from the first page of each file in the InnoDB system tablespace.
If there are multiple files, the minimum and maximum LSN can differ.
These numbers are passed to InnoDB startup.

Having the number in other files than the first file of the InnoDB
system tablespace is not providing much additional value. It is
conflicting with other use of the field, such as on InnoDB R-tree
index pages and encryption key_version.

This worklog will stop writing FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION to
other files than the first file of the InnoDB system tablespace
(page number 0:0) when system tablespace is encrypted. If tablespace
is not encrypted we continue writing FIL_PAGE_FLUSH_LSN_OR_KEY_VERSION
to all first pages of system tablespace to avoid unnecessary
warnings on downgrade.

open_or_create_data_files(): pass only one flushed_lsn parameter

xb_load_tablespaces(): pass only one flushed_lsn parameter.

buf_page_create(): Improve comment about where
FIL_PAGE_FIL_FLUSH_LSN_OR_KEY_VERSION is set.

fil_write_flushed_lsn(): A new function, merged from
fil_write_lsn_and_arch_no_to_file() and
fil_write_flushed_lsn_to_data_files().
Only write to the first page of the system tablespace (page 0:0)
if tablespace is encrypted, or write all first pages of system
tablespace and invoke fil_flush_file_spaces(FIL_TYPE_TABLESPACE)
afterwards.

fil_read_first_page(): read flush_lsn and crypt_data only from
first datafile.

fil_open_single_table_tablespace(): Remove output of LSN, because it
was only valid for the system tablespace and the undo tablespaces, not
user tablespaces.

fil_validate_single_table_tablespace(): Remove output of LSN.

checkpoint_now_set(): Use fil_write_flushed_lsn and output
a error if operation fails.

Remove lsn variable from fsp_open_info.

recv_recovery_from_checkpoint_start(): Remove unnecessary second
flush_lsn parameter.

log_empty_and_mark_files_at_shutdown(): Use fil_writte_flushed_lsn
and output error if it fails.

open_or_create_data_files(): Pass only one flushed_lsn variable.
2017-06-01 14:07:48 +03:00
Daniel Bartholomew
473f4a65e1 bump the VERSION 2017-05-31 11:39:21 -04:00
Sergei Golubchik
5e0038b376 cleanup: remove Regexp_processor_pcre::m_subpatterns_needed
it's unused now.
2017-05-29 21:07:54 +02:00
Sergei Golubchik
2372bfaa7b MDEV-12942 REGEXP_INSTR returns 1 when using brackets
always use full m_SubStrVec length in pcre_exec, we don't know
how many subexpressions user's regexp will have
2017-05-29 21:07:54 +02:00
Marko Mäkelä
22e5e64c0d MDEV-11623 merge fix: Use the correct flags in an error message 2017-05-29 14:37:24 +03:00
Marko Mäkelä
c2ef0bb6ce Merge 5.5 into 10.0 2017-05-29 13:15:36 +03:00
Marko Mäkelä
2cb94aa1b7 MDEV-11626 innodb.innodb-change-buffer-recovery fails for xtradb
buf_page_get_gen(): Remove the error log messages about
page flushing and eviction when
innodb_change_buffering_debug=1 is in effect.
2017-05-29 13:07:23 +03:00
Igor Babaev
af4421e82d Fixed the bug mdev-12931.
This corrects the patch for mdev-10006.
The current code supports only those semi-join nests that are placed at
the join top level. So such nests cannot depend on other tables or nests.
2017-05-29 00:27:14 -07:00
Jan Lindström
959195e195 Merge pull request #399 from grooverdan/10.2-MDEV-12924-readd-numa-innodb
MDEV-12924: re-add numa to innodb
2017-05-29 08:46:26 +03:00
Daniel Black
b53f6b9768 MDEV-12924: re-add numa to innodb
Commit 3a3b3d8ba8 overly purged the numa checks.

Re-add this.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-05-29 15:32:37 +10:00
Varun Gupta
e4d10e09cf MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
was corrupted, server crashes in opt_sum_query

Extended keys feature disabled if the length of extended key is longer than MAX_KEY_LEN
2017-05-28 00:40:36 +05:30
Marko Mäkelä
73deafbc17 Remove dict_index_t::is_ngram
When MySQL 5.7 introduced fulltext parser plugins to InnoDB,
it hard-coded the plugin name "ngram" to mean something special.
Because -fsanitize=undefined was issuing warnings for the
assignment in row_merge_create_index() that the value is out of
range for Boolean, we remove this code that was not intended to
be used in MariaDB 10.2.

fts_check_token(): Remove the special logic for N-gram tokens.
2017-05-26 22:45:54 +03:00
Marko Mäkelä
c0dec39da0 fts_is_charset_cjk(): Do not call strcmp()
Remove a bogus reference to gb18030_chinese_ci, which was introduced
in MySQL 5.7. It is roughly equivalent to utf8mb4_unicode_ci, just
using a different internal encoding, and different collation.
2017-05-26 22:45:54 +03:00
Marko Mäkelä
e54d521b66 Remove some noise from ib::fatal() and ib::fatal_or_error()
Avoid the redundant output from ut_dbg_assertion_failed by directly
invoking abort().
2017-05-26 22:45:54 +03:00
Marko Mäkelä
2fd840011c Remove ut_allocator::m_oom_fatal
ut_allocator: Move m_oom_fatal into a template parameter oom_fatal,
to reduce the data and code size.
2017-05-26 22:45:53 +03:00
Marko Mäkelä
acea8b5bad Fix some integer type mismatch in innochecksum 2017-05-26 22:45:53 +03:00
Marko Mäkelä
3b68515bf2 Actually enable UNIV_DEBUG_VALGRIND 2017-05-26 22:45:53 +03:00
Marko Mäkelä
e32dc40c50 Remove an unused variable 2017-05-26 22:45:53 +03:00
Marko Mäkelä
4114d1d452 Fix WITH_INNODB_EXTRA_DEBUG 2017-05-26 22:45:53 +03:00
Marko Mäkelä
8c81f24d1b Merge 10.1 into 10.2 2017-05-26 22:45:46 +03:00
Sergei Golubchik
f42e08f951 Merge branch '10.0-galera' into 10.1 2017-05-26 19:21:19 +02:00
Elena Stepanova
8c35f105d2 Latest additions to the list of unstable tests in 10.1.24 2017-05-26 19:54:09 +03:00
Elena Stepanova
994a5f29f1 On a build without performance schema the test failed
performance-schema options in option files should be loose. The tests
will be skipped after have_perfschema.inc check, but if options aren't
loose, the failure happens on server startup, before the check
2017-05-26 19:53:29 +03:00
Marko Mäkelä
808f18c748 MDEV-12926 encryption.innodb_onlinealter_encryption, encryption.innodb-bad-key-change failed in buildbot with valgrind
row_merge_write(): Pass the correct (possibly encrypted) buffer
to os_file_write_int_fd().

This bug was introduced in commit 65e1399e64
which included a commit to merge changes from MySQL 5.6.36 to
MariaDB Server 10.0.
2017-05-26 19:13:21 +03:00
Marko Mäkelä
2f29fc3c1c 10.1 additions for MDEV-12052 Shutdown crash presumably due to master thread activity
btr_defragment_thread(): Create the thread in the same place as other
threads. Do not invoke btr_defragment_shutdown(), because
row_drop_tables_for_mysql_in_background() in the master thread can still
keep invoking btr_defragment_remove_table().

logs_empty_and_mark_files_at_shutdown(): Wait for btr_defragment_thread()
to exit.

innobase_start_or_create_for_mysql(), innobase_shutdown_for_mysql():
Skip encryption and scrubbing in innodb_read_only_mode.

srv_export_innodb_status(): Do not export encryption or scrubbing
statistics in innodb_read_only mode, because the threads will not
be running.
2017-05-26 15:19:40 +03:00