Commit graph

20030 commits

Author SHA1 Message Date
Marko Mäkelä
93ed717b3d Relax debug assertions for undo tablespace recovery 2018-09-07 22:06:20 +03:00
Marko Mäkelä
9f6a0d291f row_purge_parse_undo_rec(): Deduplicate some code 2018-09-07 22:06:20 +03:00
Marko Mäkelä
68466bb485 innobase_init(): Remove an unnecessary condition
Because innodb_file_per_table can be enabled at runtime after it
was disabled at startup, it is better to always register the same
innobase_hton->tablefile_extensions. Besides,
innodb_file_per_table=OFF does not prevent loading tables that may
have been created earlier with the .ibd file extension.
2018-09-07 22:06:20 +03:00
Vladislav Vaintroub
67b87e1d76 Rocksdb, Windows - better fix for broken WIN32_LEAN_AND_MEAN
(https://github.com/facebook/rocksdb/issues/4344)
Also, disable /permissive- flag if set, it breaks rocksdb compilation
in 10.3 on older versions of Windows 8.1 SDK.
2018-09-05 19:32:31 +01:00
Sergei Petrunia
2676f3371c Post-merge fixes: Disable rpl_mts_dependency_unique_key_conflicts test
It uses --slave-use-idempotent-for-recovery which is not available in MariaDB.
2018-09-03 12:19:16 +03:00
Sergei Petrunia
865831c683 Merge branch 'bb-10.2-mariarocks-merge' into 10.2 2018-08-31 16:36:27 +03:00
Sergei Petrunia
52e0dee037 MyRocks: post-merge fixes: disable rocksdb.use_direct_reads
Direct IO doesnt work on all filesystems, e.g. it doesnt work on the
disk of kvm-bintar-trusty-amd64.
2018-08-31 16:30:21 +03:00
Marko Mäkelä
206528f722 Merge 10.1 into 10.2 2018-08-31 15:10:02 +03:00
Sergei Petrunia
a55309d926 MyRocks: post-merge fixes: Make it compile on Windows. 2018-08-31 13:21:46 +03:00
Marko Mäkelä
f693170c75 MDEV-16647 InnoDB fails to drop large temporary table on disconnect
This regression was introduced in MDEV-16515.
We would fail to drop a temporary table on client disconnect,
because trx_is_interrupted() would hold. To add insult to
injury, in MariaDB 10.1, InnoDB temporary tables are actually
persistent, so the garbage temporary tables will never be dropped.

row_drop_table_for_mysql(): If several iterations of
buf_LRU_drop_page_hash_for_tablespace() are needed,
do not interrupt dropping a temporary table even after
the transaction was marked as killed.

Server shutdown will still terminate the loop, and also DROP TABLE
of persistent tables will keep checking if the execution was aborted.
2018-08-31 13:16:31 +03:00
Marko Mäkelä
3b5d3cd68e Revert MDEV-9519 due to regressions
This reverts commit 75dfd4acb9.
2018-08-31 12:36:31 +03:00
Sergei Petrunia
2770eb1b56 MyRocks: post-merge fixes part #10: disable rocksdb.percona_nonflushing_analyze_debug
It uses a feature that's not available in MariaDB
2018-08-30 22:30:26 +03:00
Sergei Petrunia
9793398142 MyRocks: post-merge fixes part #9: disable rocksdb_rpl.rpl_missing_columns_sk_update
It uses a feature that's not available in MariaDB
2018-08-30 22:16:16 +03:00
Sergei Petrunia
206aba5910 MyRocks: post-merge fixes part #8: make rocksdb.validate_datadic test pass 2018-08-30 21:30:40 +03:00
Sergei Petrunia
d4f3c5c42f MyRocks: post-merge fixes part #7: make rocksdb.check_ignore_unknown_options test pass 2018-08-30 21:18:53 +03:00
Sergei Petrunia
290368e740 MyRocks: post-merge fixes part #6: make rocksdb.allow_no_primary_key test pass 2018-08-30 12:55:03 +03:00
Sergei Petrunia
5e4f3af9b7 MyRocks: post-merge fixes part #5: make rocksdb.rocksdb_checksums test pass 2018-08-29 17:25:58 +03:00
Sergei Petrunia
3d2c0f61e7 MyRocks: Post-merge testcase fixes part #4 2018-08-28 17:35:52 +03:00
Sergei Petrunia
138605c3b7 MyRocks: Post-merge testcase fixes part #3 2018-08-28 16:30:22 +03:00
Sergei Petrunia
f561e63fdd MyRocks: Post-merge testcase fixes part #2 2018-08-28 16:18:02 +03:00
Sergei Petrunia
a01823a33f MyRocks: Post-merge testcase fixes part #1 2018-08-28 12:43:00 +00:00
Sergei Petrunia
c930afd47e Merge branch 'merge-myrocks' of github.com:MariaDB/mergetrees into bb-10.2-mariarocks-merge
Move up-to this revision in the upstream:

  commit de1e8c7bfe7c875ea284b55040e8f3cd3a56fcc2
  Author: Abhinav Sharma <abhinavsharma@fb.com>
  Date:   Thu Aug 23 14:34:39 2018 -0700

      Log updates to semi-sync whitelist in the error log

      Summary:
      Plugin variable changes are not logged in the error log even when
      log_global_var_changes is enabled. Logging updates to whitelist will help in
      debugging.

      Reviewed By: guokeno0

      Differential Revision: D9483807

      fbshipit-source-id: e111cda773d
2018-08-28 14:09:04 +03:00
Sergei Petrunia
faa4d8f8c6 Copy of
commit de1e8c7bfe7c875ea284b55040e8f3cd3a56fcc2
Author: Abhinav Sharma <abhinavsharma@fb.com>
Date:   Thu Aug 23 14:34:39 2018 -0700

    Log updates to semi-sync whitelist in the error log

    Summary:
    Plugin variable changes are not logged in the error log even when
    log_global_var_changes is enabled. Logging updates to whitelist will help in
    debugging.

    Reviewed By: guokeno0

    Differential Revision: D9483807

    fbshipit-source-id: e111cda773d
2018-08-28 08:23:44 +00:00
Monty
cded083a37 MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexes
Problem was that a parallel open of a table, overwrote info->state that
was in used by repair.

Fixed by changing _ma_tmp_disable_logging_for_table() to use
a new state buffer state.no_logging to store the temporary state.

Other things:
- Use original number of rows when retrying repair to get rid of a
  potential warning "Number of rows changed from X to Y"
- Changed maria_commit() to make it easier to merge with 10.4
- If table is not locked (like with show commands), use the global
  number of rows as the local number may not be up to date.
  (Minor not critical fix)
- Added some missing DBUG_RETURN
2018-08-27 22:00:14 +03:00
Ming Lin
2b76f6f61d MDEV-16703: Update AUTO_INCREMENT in the UPDATE statement
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

(cherry picked from commit f7154242b8)
2018-08-26 15:10:32 +03:00
Marko Mäkelä
1b4c5b7327 MDEV-16868 Same query gives different results
An INSERT into a temporary table would fail to set the
index page as modified. If there were no other write operations
(such as UPDATE or DELETE) to the page, and the page was evicted,
we would read back the old contents of the page, causing
corruption or loss of data.

page_cur_insert_rec_write_log(): Call mtr_t::set_modified()
for temporary tables. Normally this is part of the mlog_open()
call, but the mlog_open() call was only present in debug builds.
This regression was caused by
commit 48192f963a
which was preparation for MDEV-11369 and supposed to affect
debug builds only.

Thanks to Thirunarayanan Balathandayuthapani for debugging.
2018-08-24 09:38:52 +03:00
Marko Mäkelä
c164d0cc62 fil_name_process(): Remove unused return value 2018-08-23 17:02:50 +03:00
Marko Mäkelä
9a815401c6 MDEV-17043 Purge of indexed virtual columns may cause hang on table-rebuilding DDL
When a table is renamed to an internal #sql2 or #sql-ib name during
a table-rebuilding DDL operation such as OPTIMIZE TABLE or ALTER TABLE,
and shortly after that a purge operation in an index on virtual columns
is attempted, the operation could fail, but purge would fail to release
the table reference.

innodb_acquire_mdl(): Release the reference if the table name is not
valid for acquiring a meta-data lock (MDL).

innodb_find_table_for_vc(): Add a debug assertion if the table name
is not valid. This code path is for DML execution. The table
should have a valid name for executing DML, and furthermore a MDL
will prevent the table from being renamed.

row_vers_build_clust_v_col(): Add a debug assertion that both indexes
must belong to the same table.
2018-08-23 13:11:11 +03:00
Jan Lindström
b87b8c1344
Merge pull request #828 from tempesta-tech/sysprg/10.1-MDEV-10754
MDEV-10754 wsrep_sst_rsync does not support innodb_data_home_dir
2018-08-21 15:58:09 +03:00
Marko Mäkelä
9258097fa3 Merge 10.1 into 10.2 2018-08-21 15:20:34 +03:00
Marko Mäkelä
dc7c080369 MDEV-17026 Assertion srv_undo_sources || ... failed on slow shutdown
trx_purge_add_update_undo_to_history(): Relax the too strict assertion
by removing the condition on srv_fast_shutdown (innodb_fast_shutdown).
Rollback is allowed during any form of shutdown.
2018-08-21 12:33:41 +03:00
Marko Mäkelä
45dbd47026 MDEV-17003 service_manager_extend_timeout() being called too often
buf_dump(): Only generate the output when shutdown is in progress.

log_write_up_to(): Only generate the output before actually writing
to the redo log files.

srv_purge_should_exit(): Rate-limit the output, and instead of
displaying the work done, indicate the work that remains to be done
until the completion of the slow shutdown.
2018-08-21 12:33:40 +03:00
Marko Mäkelä
cdc8debcaa MDEV-16557 Remove INNOBASE_SHARE 2018-08-21 12:10:21 +03:00
Marko Mäkelä
cccdb176a6 MDEV-16862 build failure for WITH_INNODB_AHI=0
Fix the build, which was broken by MDEV-16515.
2018-08-21 12:10:18 +03:00
Marko Mäkelä
d6f7fd6016 MDEV-13564: Refuse MLOG_TRUNCATE in mariabackup
The MySQL 5.7 TRUNCATE TABLE is inherently incompatible
with hot backup, because it is creating and deleting a separate
log file, and it is not writing redo log for all changes of the
InnoDB data dictionary tables. Refuse to create a corrupted backup
if the unsafe form of TRUNCATE was executed.

Note: Undo log tablespace truncation cannot be detected easily.
Also it is incompatible with backup, for similar reasons.

xtrabackup_backup_func(): "Subscribe to" the log events before
the first invocation of xtrabackup_copy_logfile().

recv_parse_or_apply_log_rec_body(): If the function pointer
log_truncate is set, invoke it to report MLOG_TRUNCATE.
2018-08-16 16:10:18 +03:00
Marko Mäkelä
05153a670d Report all redo log corruption
Amend commit b853b4fd88
that was reverted in commit 29150e2391.

recv_parse_log_recs(): Do check for corrupted redo log or file
system before checking for len==0, but only read *ptr if
it is not past the end of the buffer (end_ptr).

recv_parse_log_rec(): Report incorrect redo log type
in a consistent way with recv_parse_or_apply_log_rec_body().
This is a follow-up to commit f30c5af42e.
2018-08-16 06:37:52 +03:00
Marko Mäkelä
a0ce321627 MDEV-16136 Various ASAN failures after MDEV-15030
The Pool poisoning that was introduced in MDEV-15030 introduced
race conditions in AddressSanitizer builds, because concurrent
poisoning and unpoisoning were not prevented by any synchronization
primitive.

Pool::get(): Protect the unpoisoning by m_lock_strategy.

Pool::mem_free(): Protect the poisoning by m_lock_strategy.

Pool::putl(): Renamed from put(), because now the caller is
responsible for invoking m_lock_strategy.
2018-08-16 05:55:17 +03:00
Marko Mäkelä
fa2a74e08d MDEV-16136: Prevent wrong reuse in trx_reference()
If trx_free() and trx_create_low() were called while a call to
trx_reference() was pending, we could get a reference to a wrong
transaction object.

trx_reference(): Return NULL if the trx->id no longer matches.

lock_trx_release_locks(): Assign trx->id = 0, so that trx_reference()
will not return a reference to this object.

trx_cleanup_at_db_startup(): Assign trx->id = 0.

assert_trx_is_free(): Assert !trx->n_ref. Assert trx->id == 0,
now that it will be cleared as part of a transaction commit.
2018-08-16 05:54:11 +03:00
Marko Mäkelä
6583506570 Rename lock_pool_t to lock_list
Also, replace reverse iteration with forward iteration.

lock_table_has(): Remove a redundant condition.
2018-08-16 05:53:50 +03:00
Marko Mäkelä
3ce8a0fc49 MDEV-16136: Simplify trx_lock_t memory management
Allocate trx->lock.rec_pool and trx->lock.table_pool directly from trx_t.
Remove unnecessary use of std::vector.

In order to do this, move some definitions from lock0priv.h to
lock0types.h, so that ib_lock_t will not be an opaque type.
2018-08-16 05:53:38 +03:00
Julius Goryavsky
75dfd4acb9 This is patch for the https://jira.mariadb.org/browse/MDEV-9519 issue:
If we have a 2+ node cluster which is replicating from an async master
and the binlog_format is set to STATEMENT and multi-row inserts are executed
on a table with an auto_increment column such that values are automatically
generated by MySQL, then the server node generates wrong auto_increment
values, which are different from what was generated on the async master.

The causes and fixes:

1. We need to improve processing of changing the auto-increment values
after changing the cluster size.

2. If wsrep auto_increment_control switched on during operation of
the node, then we should immediately update the auto_increment_increment
and auto_increment_offset global variables, without waiting of the next
invocation of the wsrep_view_handler_cb() callback. In the current version
these variables retain its initial values if wsrep_auto_increment_control
is switched on during operation of the node, which leads to inconsistent
results on the different nodes in some scenarios.

3. If wsrep auto_increment_control switched off during operation of the node,
then we must return the original values of the auto_increment_increment and
auto_increment_offset global variables, as the user has set. To make this
possible, we need to add a "shadow copies" of these variables (which stores
the latest values set by the user).
2018-08-15 14:17:28 +03:00
Vladislav Vaintroub
b795134802 MDEV-16859 MyRocks: support SSE42 CRC32-C instruction. 2018-08-15 11:18:49 +01:00
Vladislav Vaintroub
922e7badfc MDEV-16791 mariabackup : Support DDL commands during backup 2018-08-14 15:11:13 +01:00
Sergei Petrunia
562dd53c29 MDEV-16575: rocksdb.bulk_load_errors fails in buildbot with wrong result
Fix a race condition in the test.
2018-08-13 18:56:52 +03:00
Sergei Petrunia
ba10ffe0f4 MDEV-16203: autoinc_debug of rocksdb test suite fails
The test causes simulated server crashes with DBUG_SUICIDE();.

It also relies on transactions that were committed right before the
crash to be visible after the crash (that is, it requires durability).

Run the test with transaction durability enabled: set
rocksdb-flush-log-at-trx-commit=1.
2018-08-12 22:10:32 +03:00
Marko Mäkelä
29150e2391 Revert part of b853b4fd88
recv_parse_log_recs(): Do not check for corruption before
checking for end-of-log-buffer. For some reason, adding the
check to the logical-looking place would cause intermittent
recovery failures in the tests innodb.innodb-index and
innodb_gis.rtree_compress2.
2018-08-10 17:01:53 +03:00
Marko Mäkelä
b853b4fd88 Report InnoDB redo log corruption better
recv_parse_log_recs(): Check for corruption before checking for
end-of-log-buffer.

mlog_parse_initial_log_record(), page_cur_parse_delete_rec():
Flag corruption for out-of-bounds values, and let the caller
dump the corrupted redo log extract.
2018-08-10 13:02:01 +03:00
Marko Mäkelä
0e15ae1602 recv_report_corrupt_log(): Avoid buffer overflow
If recv_sys_justify_left_parsing_buf() has been invoked, it is possible
that recv_previous_parsed_rec_offset is after the current offset.
In this case, we must not dump any bytes before the current record.
2018-08-10 10:00:47 +03:00
Marko Mäkelä
bdf50c3ebd log_group_read_log_seg(): Validate the length
If the LOG_BLOCK_HDR_DATA_LEN field is corrupted, scanning the
log records could fail in strange ways. It is better to validate
the field as part of validating each log block.
2018-08-09 19:42:46 +03:00
Marko Mäkelä
f30c5af42e InnoDB: Correct an error message
Display the log record type in hexadecimal, not binary.
2018-08-09 17:38:40 +03:00