Commit graph

1270 commits

Author SHA1 Message Date
Jan Lindström
9f31949b64 MDEV-10739: encryption.innodb-page_encryption_compression fails with timeout on valgrind
Test moved to big_test and not run on valgrind. Test heavy especially on debug builds.
2016-11-29 08:35:51 +02:00
Marko Mäkelä
a68d1352b6 MDEV-11349 (2/2) Fix some bogus-looking Valgrind warnings
buf_block_init(): Initialize buf_page_t::flush_type.
For some reason, Valgrind 3.12.0 would seem to flag some
bits in adjacent bitfields as uninitialized, even though only
the two bits of flush_type were left uninitialized. Initialize
the field to get rid of many warnings.

buf_page_init_low(): Initialize buf_page_t::old.
For some reason, Valgrind 3.12.0 would seem to flag all 32
bits uninitialized when buf_page_init_for_read() invokes
buf_LRU_add_block(bpage, TRUE). This would trigger bogus warnings
for buf_page_t::freed_page_clock being uninitialized.
(The V-bits would later claim that only "old" is initialized
in the 32-bit word.) Perhaps recent compilers
(GCC 6.2.1 and clang 4.0.0) generate more optimized x86_64 code
for bitfield operations, confusing Valgrind?

mach_write_to_1(), mach_write_to_2(), mach_write_to_3():
Rewrite the assertions that ensure that the most significant
bits are zero. Apparently, clang 4.0.0 would optimize expressions
of the form ((n | 0xFF) <= 0x100) to (n <= 0x100). The redundant
0xFF was added in the first place in order to suppress a
Valgrind warning. (Valgrind would warn about comparing uninitialized
values even in the case when the uninitialized bits do not affect
the result of the comparison.)
2016-11-25 12:34:02 +02:00
Marko Mäkelä
8da33e3a86 MDEV-11349 (1/2) Fix some clang 4.0 warnings
In InnoDB and XtraDB functions that declare pointer parameters as nonnull,
remove nullness checks, because GCC would optimize them away anyway.

Use #ifdef instead of #if when checking for a configuration flag.

Clang says that left shifts of negative values are undefined.
So, use ~0U instead of ~0 in a number of macros.

Some functions that were defined as UNIV_INLINE were declared as
UNIV_INTERN. Consistently use the same type of linkage.

ibuf_merge_or_delete_for_page() could pass bitmap_page=NULL to
buf_page_print(), conflicting with the __attribute__((nonnull)).
2016-11-25 09:09:51 +02:00
Jan Lindström
1fee0171bc MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock
When we enter here wait_lock could be already gone i.e. NULL, that
should be allowed.
2016-11-09 15:23:25 +02:00
Sergei Golubchik
a98c85bb50 Merge branch '10.0-galera' into 10.1 2016-11-02 13:44:07 +01:00
Jan Lindström
554c60ab0d MDEV-11182: InnoDB: Assertion failure in file buf0buf.cc line 4730 (encryption.create_or_replace fails in buildbot and outside)
Analysis: Problem is that page is encrypted but encryption information
on page 0 has already being changed.

Fix: If page header contains key_version != 0 and even if based on
current encryption information tablespace is not encrypted we
need to check is page corrupted. If it is not, then we know that
page is not encrypted. If page is corrupted, we need to try to
decrypt it and then compare the stored and calculated checksums
to see is page corrupted or not.
2016-10-31 12:44:06 +02:00
Jan Lindström
de0f77a2a8 MDEV-11106: Improve error messages when importing tablespaces
Add error message when used index_id in index page is not found
from configuration file.
2016-10-29 10:09:06 +03:00
Jan Lindström
84ce681969 MDEV-10917: Warning suggesting that innodb_page_size is experimental may be inaccurate
Removed experimental from message.
2016-10-29 10:09:06 +03:00
Jan Lindström
885577fb10 MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing
Two problems:

(1) When pushing warning to sql-layer we need to check that thd != NULL
to avoid NULL-pointer reference.

(2) At tablespace key rotation if used key_id is not found from
encryption plugin tablespace should not be rotated.
2016-10-29 10:09:06 +03:00
Jan Lindström
bc323727de MDEV-10977: [ERROR] InnoDB: Block in space_id 0 in file ibdata1 encrypted.
MDEV-10394: Innodb system table space corrupted

Analysis: After we have read the page in buf_page_io_complete try to
find if the page is encrypted or corrupted. Encryption was determined
by reading FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION field from FIL-header
as a key_version. However, this field is not always zero even when
encryption is not used. Thus, incorrect key_version could lead situation where
decryption is tried to page that is not encrypted.

Fix: We still read key_version information from FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
field but also check if tablespace has encryption information before trying
encrypt the page.
2016-10-29 10:09:06 +03:00
Nirbhay Choubey
5db2195a35 Merge tag 'mariadb-10.0.28' into 10.0-galera 2016-10-28 15:50:13 -04:00
Vladislav Vaintroub
ad5b88a892 Fix build error in XtraDB on Windows.
coming from Percona's workaround for glibc bug
http://bugs.mysql.com/bug.php?id=82886
2016-10-26 09:26:34 +00:00
Jan Lindström
ea0ae42d83 Merge pull request #250 from sensssz/10.1-vats
A few fixes for VATS in 10.1
2016-10-26 08:34:04 +03:00
sensssz
74961760a4 A few fixes for VATS in 10.1 2016-10-25 18:57:03 -04:00
Sergei Golubchik
675f27b382 Merge branch 'merge/merge-xtradb-5.6' into 10.0
commented out the "compressed columns" feature
2016-10-25 18:28:31 +02:00
Sergei Golubchik
d7dc03a267 5.6.33-79.0 2016-10-25 17:01:37 +02:00
Sergei Golubchik
12c3e16dfa Merge branch '5.5' into 10.0 2016-10-25 16:41:43 +02:00
Jan Lindström
4edd4ad698 MDEV-10970: Crash while loading mysqldump backup when InnoDB encryption is enabled
Follow-up: Make sure we do not reference NULL-pointer when space is being
dropped and does not contain any nodes.
2016-10-24 22:27:27 +03:00
Jan Lindström
021212b525 Merge pull request #245 from sensssz/10.1-vats
MDEV-11039 - Add new scheduling algorithm for reducing tail latencies
2016-10-24 21:51:42 +03:00
Jan Lindström
1bfa37a79c Add more information if encryption information is already stored for
tablespace but page0 is not yet read.
2016-10-24 16:55:36 +03:00
Hyeonseok Oh
9401e6befd Remove unnecessary semicolons 2016-10-24 14:58:41 +09:00
Vladislav Vaintroub
ee1d08c115 Revert "Prepare XtraDB to be used with xtrabackup."
This reverts commit de5646f1a9.
2016-10-23 00:10:37 +00:00
Vladislav Vaintroub
de5646f1a9 Prepare XtraDB to be used with xtrabackup.
The changes are deliberately kept minimal

- some functions are made global instead of static (they will be used in
xtrabackup later on)

- functions got additional parameter, deliberately unused for now :
  fil_load_single_tablespaces
  srv_undo_tablespaces_init

- Global variables added, also unused for now :
   srv_archive_recovery
   srv_archive_recovery_limit_lsn
   srv_apply_log_only
   srv_backup_mode
   srv_close_files

- To make xtrabackup link with sql.lib on Windows, added some missing
  source files to sql.lib

- Fixed os_thread_ret_t to be DWORD on Windows
2016-10-22 14:10:12 +00:00
Sergei Golubchik
eac8d95ffc compilation warning after xtradb merge 2016-10-14 12:51:53 +02:00
Sergei Golubchik
e4957de4fd Merge branch 'merge-xtradb-5.5' into 5.5 2016-10-13 12:40:24 +02:00
Sergei Golubchik
6010a27c87 5.5.52-38.3 2016-10-13 12:23:16 +02:00
sensssz
183c02839f Move the lock after deadlock is resolved. 2016-10-13 01:23:21 -04:00
sensssz
0a769b00b5 Get thd by lock->trx->mysql_thd. 2016-10-12 21:54:31 -04:00
sensssz
5dc7ad87b8 Reduce conflict during in-order replication. 2016-10-12 21:52:14 -04:00
sensssz
288796f927 Bug fix: missing * and ; 2016-10-11 23:05:02 -04:00
sensssz
e93d44f2d7 Bug fix: add undeclared variables. 2016-10-11 23:02:26 -04:00
sensssz
6100f59ffa Implement VATS both in InnoDB and XtraDB. Add configuration options for it in both of them. 2016-10-11 20:52:35 -04:00
Sergei Golubchik
66d9696596 Merge branch '10.0' into 10.1 2016-09-28 17:55:28 +02:00
Sergei Petrunia
23af6f5942 Merge branch '10.0' of github.com:MariaDB/server into 10.0 2016-09-28 16:19:58 +03:00
Sergei Petrunia
66a58f46e9 Merge fix for MDEV-10649 from 10.0 to 10.1
- storage/innobase/dict/dict0stats.cc
- storage/xtradb/dict/dict0stats.cc
2016-09-28 16:19:05 +03:00
Sergei Petrunia
a53f3c6d3c MDEV-10649: Optimizer sometimes use "index" instead of "range" access for UPDATE
(Fixing both InnoDB and XtraDB)

Re-opening a TABLE object (after e.g. FLUSH TABLES or open table cache
eviction) causes ha_innobase to call
dict_stats_update(DICT_STATS_FETCH_ONLY_IF_NOT_IN_MEMORY).

Inside this call, the following is done:
  dict_stats_empty_table(table);
  dict_stats_copy(table, t);

On the other hand, commands like UPDATE make this call to get the "rows in
table" statistics in table->stats.records:

  ha_innobase->info(HA_STATUS_VARIABLE|HA_STATUS_NO_LOCK)

note the HA_STATUS_NO_LOCK parameter. It means, no locks are taken by
::info() If the ::info() call happens between dict_stats_empty_table
and dict_stats_copy calls, the UPDATE's optimizer will get an estimate
of table->stats.records=1, which causes it to pick a full table scan,
which in turn will take a lot of row locks and cause other bad
consequences.
2016-09-28 16:12:58 +03:00
Sergei Golubchik
bb8b658954 Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-09-27 18:58:57 +02:00
Sergei Golubchik
93ab3093cb 5.6.32-78.1 2016-09-27 18:00:59 +02:00
Jan Lindström
452e849522 MDEV-10886: encryption.innodb-bad-key-change fails (crashes) in buildbot
Problem was that NULL-pointer was accessed inside a macro when
page read from tablespace is encrypted but decrypt fails because
of incorrect key file.

Removed unsafe macro using inlined function where used pointers
are checked.
2016-09-27 07:54:27 +03:00
Jan Lindström
7d7b92c107 Disable encryption info and first page read info for every tablespace
on product builds.
2016-09-24 14:22:44 +03:00
Jan Lindström
1d55cfce10 Do not use os_file_read() directly for reading first page of the
tablespace. Instead use fil_read() with syncronous setting.
Fix test failures and mask tablespace number as it could
change in concurrent mtr runs.
2016-09-22 21:47:27 +03:00
Jan Lindström
2bedc3978b MDEV-9931: InnoDB reads first page of every .ibd file at startup
Analysis: By design InnoDB was reading first page of every .ibd file
at startup to find out is tablespace encrypted or not. This is
because tablespace could have been encrypted always, not
encrypted newer or encrypted based on configuration and this
information can be find realible only from first page of .ibd file.

Fix: Do not read first page of every .ibd file at startup. Instead
whenever tablespace is first time accedded we will read the first
page to find necessary information about tablespace encryption
status.

TODO: Add support for SYS_TABLEOPTIONS where all table options
encryption information included will be stored.
2016-09-22 16:38:24 +03:00
Sergei Golubchik
61fd38a1de update plugin maturities 2016-09-05 17:11:14 +02:00
Nirbhay Choubey
90266e8a0e Merge branch '10.0-galera' into bb-10.1-serg 2016-08-25 15:39:39 -04:00
Sergei Golubchik
6b1863b830 Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
Vicențiu Ciorbaru
ed99e2cdd3 MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_func
Followup from 5.5 patch. Removing memory barriers on intel is wrong as
this doesn't prevent the compiler and/or processor from reorganizing reads
before the mutex release. Forcing a memory barrier before reading the waiters will
guarantee that no speculative reading takes place.
2016-08-23 21:24:36 +03:00
Nirbhay Choubey
3f481e52e4 Fixes for failing tests (post-merge). 2016-08-21 20:09:05 -04:00
sjaakola
415823a41c Refs: MW-279
- fixes in innodb to skip wsrep processing (like kill victim) when running in native mysql mode
- similar fixes in mysql server side
- forcing tc_log_dummy in native mysql mode when no binlog used. wsrep hton messes up handler counter
  and used to lead in using tc_log_mmap instead. Bad news is that tc_log_mmap does not seem to work at all
2016-08-21 16:20:09 -04:00
Sergei Golubchik
47a1087ff6 Merge branch 'bb-10.0-serg' into 10.0 2016-08-14 09:16:07 +02:00