Commit graph

66329 commits

Author SHA1 Message Date
Vladislav Vaintroub
64b3427b89 Run mariabackup test on Windows on buildbot 2017-04-27 19:12:41 +02:00
Vladislav Vaintroub
ca24f35b67 MDEV-9566 MariaBackup test suite 2017-04-27 19:12:40 +02:00
Vladislav Vaintroub
ec68f764f6 MDEV-9566 prepare mysqltest for mariabackup
- Do not throw output of exec command, if disable_result_log is set
save and dump it if exec fails. Need tha to meaningfully analyze
errors from mariabackup.

- rmdir now removes the entire tree. need that because xtrabackup tests
clean the whole directory.

- all filesystem modifying commands now require the argument to
  be under MYSQLTEST_VARDIR or MYSQL_TMP_DIR.
2017-04-27 19:12:38 +02:00
Vladislav Vaintroub
7bf409593e MDEV-11660 Make encryption plugins "pure"
Do not exporting mysqld entry points directly.
This is needed for mariabackup, to load encryption plugins on Windows.

All plugins are "pure" by default. To mark plugin "impure"
it should use RECOMPILE_FOR_EMBEDDED or STORAGE_ENGINE keyword.
2017-04-27 19:12:38 +02:00
Vladislav Vaintroub
db39107413 MDEV-11663 Create services for functionality used by plugins
Added service for
- encryption (AES)
- error reporting, e.g my_printf_error()
2017-04-27 19:12:38 +02:00
Jan Lindström
765a43605a MDEV-12253: Buffer pool blocks are accessed after they have been freed
Problem was that bpage was referenced after it was already freed
from LRU. Fixed by adding a new variable encrypted that is
passed down to buf_page_check_corrupt() and used in
buf_page_get_gen() to stop processing page read.

This patch should also address following test failures and
bugs:

MDEV-12419: IMPORT should not look up tablespace in
PageConverter::validate(). This is now removed.

MDEV-10099: encryption.innodb_onlinealter_encryption fails
sporadically in buildbot

MDEV-11420: encryption.innodb_encryption-page-compression
failed in buildbot

MDEV-11222: encryption.encrypt_and_grep failed in buildbot on P8

Removed dict_table_t::is_encrypted and dict_table_t::ibd_file_missing
and replaced these with dict_table_t::file_unreadable. Table
ibd file is missing if fil_get_space(space_id) returns NULL
and encrypted if not. Removed dict_table_t::is_corrupted field.

Ported FilSpace class from 10.2 and using that on buf_page_check_corrupt(),
buf_page_decrypt_after_read(), buf_page_encrypt_before_write(),
buf_dblwr_process(), buf_read_page(), dict_stats_save_defrag_stats().

Added test cases when enrypted page could be read while doing
redo log crash recovery. Also added test case for row compressed
blobs.

btr_cur_open_at_index_side_func(),
btr_cur_open_at_rnd_pos_func(): Avoid referencing block that is
NULL.

buf_page_get_zip(): Issue error if page read fails.

buf_page_get_gen(): Use dberr_t for error detection and
do not reference bpage after we hare freed it.

buf_mark_space_corrupt(): remove bpage from LRU also when
it is encrypted.

buf_page_check_corrupt(): @return DB_SUCCESS if page has
been read and is not corrupted,
DB_PAGE_CORRUPTED if page based on checksum check is corrupted,
DB_DECRYPTION_FAILED if page post encryption checksum matches but
after decryption normal page checksum does not match. In read
case only DB_SUCCESS is possible.

buf_page_io_complete(): use dberr_t for error handling.

buf_flush_write_block_low(),
buf_read_ahead_random(),
buf_read_page_async(),
buf_read_ahead_linear(),
buf_read_ibuf_merge_pages(),
buf_read_recv_pages(),
fil_aio_wait():
        Issue error if page read fails.

btr_pcur_move_to_next_page(): Do not reference page if it is
NULL.

Introduced dict_table_t::is_readable() and dict_index_t::is_readable()
that will return true if tablespace exists and pages read from
tablespace are not corrupted or page decryption failed.
Removed buf_page_t::key_version. After page decryption the
key version is not removed from page frame. For unencrypted
pages, old key_version is removed at buf_page_encrypt_before_write()

dict_stats_update_transient_for_index(),
dict_stats_update_transient()
        Do not continue if table decryption failed or table
        is corrupted.

dict0stats.cc: Introduced a dict_stats_report_error function
to avoid code duplication.

fil_parse_write_crypt_data():
        Check that key read from redo log entry is found from
        encryption plugin and if it is not, refuse to start.

PageConverter::validate(): Removed access to fil_space_t as
tablespace is not available during import.

Fixed error code on innodb.innodb test.

Merged test cased innodb-bad-key-change5 and innodb-bad-key-shutdown
to innodb-bad-key-change2.  Removed innodb-bad-key-change5 test.
Decreased unnecessary complexity on some long lasting tests.

Removed fil_inc_pending_ops(), fil_decr_pending_ops(),
fil_get_first_space(), fil_get_next_space(),
fil_get_first_space_safe(), fil_get_next_space_safe()
functions.

fil_space_verify_crypt_checksum(): Fixed bug found using ASAN
where FIL_PAGE_END_LSN_OLD_CHECKSUM field was incorrectly
accessed from row compressed tables. Fixed out of page frame
bug for row compressed tables in
fil_space_verify_crypt_checksum() found using ASAN. Incorrect
function was called for compressed table.

Added new tests for discard, rename table and drop (we should allow them
even when page decryption fails). Alter table rename is not allowed.
Added test for restart with innodb-force-recovery=1 when page read on
redo-recovery cant be decrypted. Added test for corrupted table where
both page data and FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION is corrupted.

Adjusted the test case innodb_bug14147491 so that it does not anymore
expect crash. Instead table is just mostly not usable.

fil0fil.h: fil_space_acquire_low is not visible function
and fil_space_acquire and fil_space_acquire_silent are
inline functions. FilSpace class uses fil_space_acquire_low
directly.

recv_apply_hashed_log_recs() does not return anything.
2017-04-26 15:19:16 +03:00
Marko Mäkelä
8c38147cdd Merge 10.0 into 10.1 2017-04-21 12:46:12 +03:00
Marko Mäkelä
87b6df31c4 MDEV-12488 Remove type mismatch in InnoDB printf-like calls
This is a reduced version of an originally much larger patch.
We will keep the definition of the ulint, lint data types unchanged,
and we will not be replacing fprintf() calls with ib_logf().

On Windows, use the standard format strings instead of nonstandard
extensions.

This patch fixes some errors in format strings.
Most notably, an IMPORT TABLESPACE error message in InnoDB was
displaying the number of columns instead of the mismatching flags.
2017-04-21 12:06:29 +03:00
Sachin Setiya
ea4146229c Fix test failure , and add galera_restart_on_unknown_option to disabled. 2017-04-06 15:41:54 +05:30
Sachin Setiya
2e889de34a Fix test cases in galera suite
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Sachin Setiya
d036cc9b2f Fix WSREP_PATCH_VERSION 2017-04-06 15:41:54 +05:30
Sachin Setiya
1ba2242ef3 MDEV-12319 Test added to disabled.def 2017-04-06 15:41:54 +05:30
Sachin Setiya
34d11b344b Fix galera_admin test
Patch credit Jan
2017-04-06 15:41:54 +05:30
Jan Lindström
2af4659b05 Fix failure on galera_toi_drop_database test.
It is assumed that both insert..select statements take so
long that drop database from node2 gets to abort them both
but on fast machines it was too small. Increased the size
of insert.
2017-04-06 15:41:54 +05:30
Sachin Setiya
5866c4d084 Fix test cases
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Sachin Setiya
bd2064e820 MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled
Signed-off-by: Sachin Setiya <sachinsetia1001@gmail.com>
2017-04-06 15:41:54 +05:30
Sachin Setiya
633959525c Fix Some failing tests
Signed-off-by: Sachin Setiya <sachinsetia1001@gmail.com>
2017-04-06 15:41:54 +05:30
Philip Stoev
66916bba2a Galera MTR Tests: Tests for MW-328 Fix unnecessary/silent BF aborts 2017-04-06 15:41:54 +05:30
Philip Stoev
97a3a07c35 Galera MTR Tests: Stability fix for MW-329 2017-04-06 15:41:54 +05:30
Philip Stoev
59f3285f35 Galera MTR Tests: Test for MW-329 Fix incorrect affected rows count after replay 2017-04-06 15:41:54 +05:30
Alexey Yurchenko
770553e185 GAL-480 MTR test 2017-04-06 15:41:54 +05:30
Philip Stoev
298daccb10 Galera MTR Test: Test for MW-28 : Assertion with --wsrep-log-conflicts 2017-04-06 15:41:54 +05:30
Sachin Setiya
70ae1dbac0 Galera MTR tests: Make the mysqlhotcopy tests pass on Ubuntu 16.04
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Philip Stoev
59dcf2a5d5 Galera MTR Tests: stability fix for galera#414.test 2017-04-06 15:41:54 +05:30
Sachin Setiya
f369942d90 Galera MTR Tests: stability fixes
* remove part of galera_var_cluster_address.test that can not be tested reliably
 * reduce running time for galera_gcache_recover_manytrx.test
 * Additional wait_conditions for GAL-401.test

Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Philip Stoev
c72e1ea940 Galera MTR Tests: Test for MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled 2017-04-06 15:41:54 +05:30
Philip Stoev
f94c9b02cf Galera MTR Tests: MW-305 , re-enable the test for ALTER USER 2017-04-06 15:41:54 +05:30
Philip Stoev
0f6aa6ba66 Galera MTR tests: Update galera_defaults.result for GAL-360 2017-04-06 15:41:54 +05:30
Sachin Setiya
c3e9110033 Galera MTR Tests: Tests for GAL-419 Respect safe_to_bootstrap flag also with gcomm://
Signed-off-by: Sachin Setiya <sachinsetia1001@gmail.com>
2017-04-06 15:41:54 +05:30
Philip Stoev
07fe265a47 Galera MTR Tests: GAL-405 Initial implementation of GCache recovery on startup. 2017-04-06 15:41:54 +05:30
Sachin Setiya
9b13147d72 Galera MTR Tests: MW-308 , MW-307, GCF-992
* a dedicated test for wsrep_retry_autocommit
* some galera_toi_* tests were only passing because wsrep_retry_autocommit
  was in effect. The tests were changed to do not use autocommit
* higher timeout values in galera_2nodes.cnf , galera_3nodes.cnf

Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Philip Stoev
09d8fbc0cf Galera MTR Tests: GCF-981 - galera_bf_abort is non deterministic 2017-04-06 15:41:54 +05:30
Philip Stoev
e043029aaa Galera MTR Tests: Test for GCF-942 - safe_to_bootstrap flag in grastate.dat 2017-04-06 15:41:54 +05:30
Sachin Setiya
e757e02417 Galera MTR Tests: Copy over some MTR tests from PXC
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-06 15:41:54 +05:30
Alexey Yurchenko
912ca4c153 GAL-401: MTR test for the fix. 2017-04-06 15:41:54 +05:30
Marko Mäkelä
25d69ea012 MDEV-12198 innodb_defragment=1 crashes server on OPTIMIZE TABLE when FULLTEXT index exists
ha_innobase::defragment_table(): Skip corrupted indexes and
FULLTEXT INDEX. In InnoDB, FULLTEXT INDEX is implemented with
auxiliary tables. We will not defragment them on OPTIMIZE TABLE.
2017-04-06 08:56:25 +03:00
Marko Mäkelä
8d4871a953 Merge 10.0 into 10.1 2017-04-06 08:53:59 +03:00
Oleksandr Byelkin
57a699b0a0 MDEV-8642: WHERE Clause not applied on View - Empty result set returned
An attempt to mark reference as dependent lead to transfering this property to
original view field and through it to other references of this field which
can't be dependent.
2017-04-05 20:46:19 +02:00
Marko Mäkelä
8e36216a06 Import two ALTER TABLE…ALGORITHM=INPLACE tests from MySQL 5.6.
Also, revert part of MDEV-7685 that added an InnoDB abort when
ALTER TABLE…ALGORITHM=INPLACE is reporting that it ran out of
file space.
2017-04-05 14:46:35 +03:00
Jan Lindström
c56b896c17 Fix test failure on debug_key_management test. 2017-03-28 12:28:09 +03:00
Marko Mäkelä
ba298b1f02 Merge 10.0 into 10.1 2017-03-24 18:20:09 +02:00
Marko Mäkelä
c51fc679f5 Merge 5.5 into 10.0 2017-03-24 18:19:15 +02:00
Marko Mäkelä
a821ef7605 MDEV-11802 innodb.innodb_bug14676111 fails on buildbot
The test was unnecessarily depending on InnoDB purge, which can
sometimes fail to proceed.

Let us rewrite the test to use BEGIN;INSERT;ROLLBACK to cause the
immediate removal of the desired records.
2017-03-24 18:01:56 +02:00
Sergei Golubchik
09a2107b1b Merge branch '10.0' into 10.1 2017-03-21 19:20:44 +01:00
Sergei Golubchik
bbf0c9d4c3 cleanup: pfs_upgrade* tests 2017-03-21 11:37:31 +01:00
Sergei Golubchik
386ef08704 MDEV-12233 main.mysql_upgrade_noengine fails in buildbot on ppc64le
verify that tests don't leave mysql_upgrade_info in datadir
2017-03-21 11:37:24 +01:00
Sergei Golubchik
0d622bed4f Merge branch '5.5' into 10.0 2017-03-21 11:35:50 +01:00
Marko Mäkelä
4c35dce296 Clean up the test mentioned in MDEV-12052.
The test is not expected to crash. With a non-debug server,
Valgrind completes in reasonable time without any failure.

Also, it does not make sense to store and restore parameters
when the parameters are already being restored by a server restart.
2017-03-18 22:50:14 +02:00
Jan Lindström
50eb40a2a8 MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing
MDEV-11581: Mariadb starts InnoDB encryption threads
when key has not changed or data scrubbing turned off

Background: Key rotation is based on background threads
(innodb-encryption-threads) periodically going through
all tablespaces on fil_system. For each tablespace
current used key version is compared to max key age
(innodb-encryption-rotate-key-age). This process
naturally takes CPU. Similarly, in same time need for
scrubbing is investigated. Currently, key rotation
is fully supported on Amazon AWS key management plugin
only but InnoDB does not have knowledge what key
management plugin is used.

This patch re-purposes innodb-encryption-rotate-key-age=0
to disable key rotation and background data scrubbing.
All new tables are added to special list for key rotation
and key rotation is based on sending a event to
background encryption threads instead of using periodic
checking (i.e. timeout).

fil0fil.cc: Added functions fil_space_acquire_low()
to acquire a tablespace when it could be dropped concurrently.
This function is used from fil_space_acquire() or
fil_space_acquire_silent() that will not print
any messages if we try to acquire space that does not exist.
fil_space_release() to release a acquired tablespace.
fil_space_next() to iterate tablespaces in fil_system
using fil_space_acquire() and fil_space_release().
Similarly, fil_space_keyrotation_next() to iterate new
list fil_system->rotation_list where new tables.
are added if key rotation is disabled.
Removed unnecessary functions fil_get_first_space_safe()
fil_get_next_space_safe()

fil_node_open_file(): After page 0 is read read also
crypt_info if it is not yet read.

btr_scrub_lock_dict_func()
buf_page_check_corrupt()
buf_page_encrypt_before_write()
buf_merge_or_delete_for_page()
lock_print_info_all_transactions()
row_fts_psort_info_init()
row_truncate_table_for_mysql()
row_drop_table_for_mysql()
    Use fil_space_acquire()/release() to access fil_space_t.

buf_page_decrypt_after_read():
    Use fil_space_get_crypt_data() because at this point
    we might not yet have read page 0.

fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly
to functions needing it and store fil_space_t* to rotation state.
Use fil_space_acquire()/release() when iterating tablespaces
and removed unnecessary is_closing from fil_crypt_t. Use
fil_space_t::is_stopping() to detect when access to
tablespace should be stopped. Removed unnecessary
fil_space_get_crypt_data().

fil_space_create(): Inform key rotation that there could
be something to do if key rotation is disabled and new
table with encryption enabled is created.
Remove unnecessary functions fil_get_first_space_safe()
and fil_get_next_space_safe(). fil_space_acquire()
and fil_space_release() are used instead. Moved
fil_space_get_crypt_data() and fil_space_set_crypt_data()
to fil0crypt.cc.

fsp_header_init(): Acquire fil_space_t*, write crypt_data
and release space.

check_table_options()
	Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_*

i_s.cc: Added ROTATING_OR_FLUSHING field to
information_schema.innodb_tablespace_encryption
to show current status of key rotation.
2017-03-14 16:23:10 +02:00
Varun Gupta
adbe1c5fe9 MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))'
failed with SELECT SQ, TEXT field

The functon find_all_keys does call Item_subselect::walk, which calls walk() for the subquery
The issue is that when a field is represented by Item_outer_ref(Item_direct_ref(Item_copy_string( ...))).
Item_copy_string does have a pointer to an Item_field in Item_copy::item but does not implement Item::walk method, so we are not
able to set the bitmap for that field. This is the reason why the assert fails.

Fixed by adding the walk method to Item_copy class.
2017-03-14 17:31:29 +05:30