Commit graph

1257 commits

Author SHA1 Message Date
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
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
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
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
Jan Lindström
9b23f8054d MDEV-10535: ALTER TABLE causes standalone/wsrep cluster crash
When checking is any of the renamed columns part of the
columns for new indexes we accessed NULL pointer if checked
column used on index was added on same statement. Additionally,
we tried to check too many indexes, added_index_count
is enough here.
2016-08-13 09:27:50 +03:00
Jan Lindström
b3df257cfd MDEV-10469: innodb.innodb-alter-tempfile fails in buildbot: InnoDB: Warning: database page corruption or a failed
Test case intentionally crashes the server and that could lead partially
written pages that are then restored from doublewrite buffer.
2016-08-13 09:27:50 +03:00
Sergei Golubchik
3863e72380 Merge branch 'merge/merge-xtradb-5.6' into 10.0
5.6.31-77.0
2016-08-10 19:55:45 +02:00
Sergei Golubchik
64752acf72 5.6.31-77.0 2016-08-10 19:24:58 +02:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Vicențiu Ciorbaru
5ad02062d9 MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_func
Fix memory barrier issues on releasing mutexes. We must have a full
memory barrier between releasing a mutex lock and reading its waiters.
This prevents us from missing to release waiters due to reading the
number of waiters speculatively before releasing the lock. If threads
try and wait between us reading the waiters count and releasing the
lock, those threads might stall indefinitely.

Also, we must use proper ACQUIRE/RELEASE semantics for atomic
operations, not ACQUIRE/ACQUIRE.
2016-08-09 23:34:44 +03:00
Sergei Golubchik
5265243cc4 Merge branch 'merge/merge-xtradb-5.5' into 5.5 2016-08-03 20:44:08 +02:00
Sergei Golubchik
e316c46f43 5.5.50-38.0 2016-08-03 20:43:29 +02:00
Jan Lindström
35c9c85634 MDEV-10217: innodb.innodb_bug59641 fails sporadically in buildbot: InnoDB: Failing assertion: current_rec != insert_rec in file page0cur.c line 1052
Added record printout when current_rec == insert_rec with lengths for
debug builds.
2016-08-03 13:46:01 +03:00
Hyeonseok Oh
558c8ce0f0 Remove unnecessary semicolon 2016-08-01 12:13:14 +09:00
Sergei Golubchik
326a8dcd87 Merge branch '10.0' into 10.1 2016-07-13 12:09:59 +02:00
Jan Lindström
406fe77763 Add more diagnostic to find out the problem on
innodb_shutdown_for_mysql in ppc64el on test
case innodb_fts.innodb_fts_stopword_charset.
2016-07-04 17:38:47 +03:00
Nirbhay Choubey
10880d67b9 Postfix: memory leak in XtraDB 2016-06-30 10:24:54 -04:00