Commit graph

11607 commits

Author SHA1 Message Date
Marko Mäkelä
947efe17ed MDEV-15158 On commit, do not write to the TRX_SYS page
This is based on a prototype by
Thirunarayanan Balathandayuthapani <thiru@mariadb.com>.

Binlog and Galera write-set replication information was written into
TRX_SYS page on each commit. Instead of writing to the TRX_SYS during
normal operation, InnoDB can make use of rollback segment header pages,
which are already being written to during a commit.

The following list of fields in rollback segment header page are added:
    TRX_RSEG_BINLOG_OFFSET
    TRX_RSEG_BINLOG_NAME (NUL-terminated; empty name = not present)
    TRX_RSEG_WSREP_XID_FORMAT (0=not present; 1=present)
    TRX_RSEG_WSREP_XID_GTRID
    TRX_RSEG_WSREP_XID_BQUAL
    TRX_RSEG_WSREP_XID_DATA

trx_sys_t: Introduce the fields
recovered_binlog_filename, recovered_binlog_offset, recovered_wsrep_xid.

To facilitate upgrade from older mysql or mariaDB versions, we will read
the information in TRX_SYS page. It will be overridden by the
information that we find in rollback segment header pages.

Mariabackup --prepare will read the metadata from the rollback
segment header pages via trx_rseg_array_init(). It will still
not read any undo log pages or recover any transactions.
2018-02-20 21:36:36 +02:00
Marko Mäkelä
2ba487cfe8 Merge bb-10.2-ext into 10.3 2018-02-19 11:37:29 +02:00
Monty
ef3147b1d6 Fix for MDEV-15105 (memory loss with LOCK sequence)
MDEV 15105 "Bytes lost and Assertion `global_status_var.global_memory_used == 0' fails on shutdown after attempts
to LOCK/RENAME sequence"
2018-02-19 11:27:21 +02:00
Monty
06ba07c269 Test case for MDEV-12887 (bug fixed long ago)
MDEV-12887 UT_LIST_GET_LEN(trx->lock.trx_locks) == 0 when mysqldump
sequence
2018-02-19 11:26:25 +02:00
Marko Mäkelä
278c036275 Merge 10.2 into bb-10.2-ext 2018-02-19 09:01:06 +02:00
Marko Mäkelä
112cb56182 Add suppressions for background page read errors 2018-02-19 08:59:36 +02:00
Vladislav Vaintroub
acab33a1f2 Merge branch '10.2-backup-fixes' into 10.2 2018-02-18 10:49:46 +00:00
Vladislav Vaintroub
e917188f99 Merge branch 'bb-10.2-wlad' into 10.2-backup-fixes 2018-02-18 10:47:23 +00:00
Marko Mäkelä
970ce270c9 Merge 10.1 into 10.2
Disable the test encryption.innodb_encryption-page-compression
because the wait_condition would seem to time out deterministically.
MDEV-14814 has to be addressed in 10.2 separately.

Datafile::validate_first_page(): Do not invoke
page_size_t::page_size_t(flags) before validating the tablespace flags.
This avoids a crash in MDEV-15333 innodb.restart test case.
FIXME: Reduce the number of error messages. The first one is enough.
2018-02-17 14:54:12 +02:00
Marko Mäkelä
9a46d97149 MDEV-15333 MariaDB (still) slow start
This performance regression was introduced in the MariaDB 10.1
file format incompatibility bug fix MDEV-11623 (MariaDB 10.1.21
and MariaDB 10.2.4) and partially fixed in MariaDB 10.1.25 in
MDEV-12610 without adding a regression test case.

On a normal startup (without crash recovery), InnoDB should not read
every .ibd data file, because this is slow. Like in MySQL, for now,
InnoDB will still open every data file (without reading), and it
will read every .ibd file for which an .isl file exists, or the
DATA DIRECTORY attribute has been specified for the table.

The test case shuts down InnoDB, moves data files, replaces them
with garbage, and then restarts InnoDB, expecting no messages to
be issued for the garbage files. (Some messages will for now be
issued for the table that uses the DATA DIRECTORY attribute.)
Finally, the test shuts down the server, restores the old data files,
and restarts again to drop the tables.

fil_open_single_table_tablespace(): Remove the condition on flags,
and only call fsp_flags_try_adjust() if validate==true
(reading the first page has been requested). The only caller with
validate==false is at server startup when we are processing all
records from SYS_TABLES. The flags passed to this function are
actually derived from SYS_TABLES.TYPE and SYS_TABLES.N_COLS,
and there never was any problem with SYS_TABLES in MariaDB 10.1.
The problem that MDEV-11623 was that incorrect tablespace flags
were computed and written to FSP_SPACE_FLAGS.
2018-02-17 14:20:33 +02:00
Marko Mäkelä
8bf2c08d54 Add a suppression for background page read error 2018-02-16 21:02:35 +02:00
Alexander Barkov
a55ded1b89 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-16 13:52:02 +04:00
Alexander Barkov
6668da2216 MDEV-15289 Binding an out-of-range DATETIME value in binary protocol breaks replication 2018-02-16 13:44:24 +04:00
Jan Lindström
21e5335154 MDEV-9962: encryption.innodb_encryption_filekeys stalled waiting for key encryption threads to decrypt all required spaces
Test changes.
2018-02-16 10:19:57 +02:00
Jan Lindström
d3fbff38b9 MDEV-14814: encryption.innodb_encryption-page-compression failed in buildbot with timeout on wait condition
Problem is that if pages are in buffer pool there is no need for
decrypt or page decompression operations.
2018-02-16 08:21:19 +02:00
Monty
144616034c Don't run sql_sequence.grant for embeddes server 2018-02-16 01:35:19 +02:00
Vladislav Vaintroub
2129eab7e2 MDEV-15071 backup does not store xtrabackup_info in the --extra-lsndir directory 2018-02-15 21:08:18 +00:00
Elena Stepanova
8df787d375 Follow-up for 54db0be3be (Added Max_index_length and Temporary) 2018-02-15 18:41:32 +02:00
Marko Mäkelä
cc3b5d1fe7 Merge bb-10.2-ext into 10.3 2018-02-15 11:48:30 +02:00
Marko Mäkelä
b006d2ead4 Merge bb-10.2-ext into 10.3 2018-02-15 10:22:03 +02:00
Monty
7bd81c726b Crash when giving error message for ALTER SEQUENCE
Fixes MDEV-14761 "Assertion `!mysql_parse_status || thd->is_error() ||
thd->get_internal_handler()' failed in parse_sql"
2018-02-15 10:18:55 +02:00
Vladislav Vaintroub
d49f8e9f05 Windows,tests : fix pcre_test_bat test from pcre library.
Tests that are not available in certain configurations, are marked as
Test command : NOT_AVAILABLE in ctest output.

pcre_test_bat does not work without ctest's -C option (--build-config
that was used earlier was wrong).
2018-02-14 23:21:58 +00:00
Monty
1fe9092d06 Fix privilege checking for sequence
MDEV-13732 User with SELECT privilege can ALTER sequence
2018-02-14 16:43:22 +02:00
Marko Mäkelä
dc09f8f29c Merge 10.2 into bb-10.2-ext 2018-02-14 10:12:53 +02:00
Marko Mäkelä
c6e35276f1 Merge 10.1 into 10.2 2018-02-14 10:01:16 +02:00
Alexey Yurchenko
a33c9a07e5 GAL-506 breaks galera_defaults MTR test by upping repl.proto_max again. Fix this once and for all by overwriting it with constant string since it makes little sense to check for it in this test. 2018-02-14 09:58:18 +02:00
Marko Mäkelä
0c4aeef976 Merge 10.2 into bb-10.2-ext 2018-02-13 16:51:45 +02:00
Marko Mäkelä
a778a62822 Re-record a result; repl.proto_max is 8, not 7 2018-02-13 16:39:51 +02:00
Marko Mäkelä
d9955b22e9 Merge 10.1 into 10.2 2018-02-13 14:49:47 +02:00
Marko Mäkelä
2202afd541 Merge 10.0 into 10.1 2018-02-13 14:32:17 +02:00
Marko Mäkelä
c051eaba46 MDEV-14988 innodb_read_only tries to modify files if transactions were recovered in COMMITTED state
lock_trx_release_locks(): Relax a debug assertion to allow
recovered TRX_STATE_COMMITTED_IN_MEMORY transactions.

trx_commit_in_memory(): Add DEBUG_SYNC instrumentation.

trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only
is set. This should only happen when a recovered committed transaction
would be cleaned up at shutdown.
2018-02-13 14:29:32 +02:00
Sergei Golubchik
f7621f17bd rename mysql.user and mysql.db column
Truncate_versioning_priv->Delete_history_priv

because the command and the privilege were renamed
2018-02-12 23:43:48 +01:00
Sergei Golubchik
f51ecfee93 MDEV-15146 SQLError[4122]: View is not system versioned
don't expand AS OF in views, and, in particular, don't auto-add
AS OF NOW().
2018-02-12 23:43:48 +01:00
Sergei Golubchik
39157fbf05 Remove ER_NON_VERSIONED_FIELD_IN_HISTORICAL_QUERY 2018-02-12 23:43:47 +01:00
Sergei Golubchik
d0f5e56a20 MDEV-14785 SYSTEM_INVISIBLE behaviour not consistent
Hide INVISIBLE_SYSTEM columns from writes and from fix_vcol_expr().
2018-02-12 23:43:47 +01:00
Monty
54db0be3be Added Max_index_length and Temporary to SHOW TABLE STATUS
- Max_index_length is supported by MyISAM and Aria tables.
- Temporary is a placeholder to signal that a table is a
  temporary table. For the moment this is always "N", except
  "Y" for generated information_schema tables and NULL for
  views. Full temporary table support will be done in another task.
  (No reason to have to update a lot of result files twice in a row)
2018-02-12 17:17:26 +02:00
Monty
19dd14e648 Updated galera .result files 2018-02-12 17:17:26 +02:00
Marko Mäkelä
00f0c039d2 MDEV-15270 Mariabackup should not try to use doublewrite buffer
When Mariabackup gets a bad read of the first page of the system
tablespace file, it would inappropriately try to apply the doublewrite
buffer and write changes back to the data file (to the source file)!
This is very wrong and must be prevented.

The correct action would be to retry reading the system tablespace
as well as any other files whose first page was read incorrectly.
Fixing this was not attempted.

xb_load_tablespaces(): Shorten a bogus message to be more relevant.
The message can be displayed by --backup or --prepare.

xtrabackup_backup_func(), os_file_write_func(): Add a missing space
to a message.

Datafile::restore_from_doublewrite(): Do not even attempt the
operation in Mariabackup.

recv_init_crash_recovery_spaces(): Do not attempt to restore the
doublewrite buffer in Mariabackup (--prepare or --export), because
all pages should have been copied correctly in --backup already,
and because --backup should ignore the doublewrite buffer.

SysTablespace::read_lsn_and_check_flags(): Do not attempt to initialize
the doublewrite buffer in Mariabackup.

innodb_make_page_dirty(): Correct the bounds check.

Datafile::read_first_page(): Correct the name of the parameter.
2018-02-12 16:56:01 +02:00
Sergei Golubchik
4fd48678ae ALTER TABLE ... DROP COLUMN sys_start
update all unique keys, not just PK
2018-02-12 14:14:35 +01:00
Sergei Golubchik
dfd42ed990 ALTER TABLE ... DROP COLUMN sys_start should rename a "dropped" column 2018-02-12 14:14:35 +01:00
Sergei Golubchik
c847089e6e Cannot DROP VERSIONING without dropping all visible AS ROW fields 2018-02-12 13:46:08 +01:00
Sergei Golubchik
f3a49e7020 Don't allow adding AS ROW START column to a not versioned table 2018-02-12 13:46:08 +01:00
Sergei Golubchik
bc0ac28f69 ALTER TABLE ... DROP VERSIONING
don't add columns to the drop list, INVISIBLE_SYSTEM columns
cannot be recognized as specified by the user
2018-02-12 13:46:07 +01:00
Sergei Golubchik
711f3dd7f5 MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
replication tests
2018-02-12 13:14:23 +01:00
Jerome Brauge
d943d7f712 MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
Standard compatible behavior for UPDATE: all assignments in SET
are executed "simultaneously", not left-to-right. And `SET a=b,b=a`
will swap the values.
2018-02-12 13:14:23 +01:00
Marko Mäkelä
33f70c4d9c MDEV-13869 MariaDB slow start
When code from MySQL 5.7.9 was merged to MariaDB 10.2.2
in commit 2e814d4702
an assignment validate=true was inadvertently added to the function
dict_check_sys_tables().

This causes InnoDB to open every single .ibd file on startup, even
when no crash recovery was needed.

Simply removing the assignment would make some tests fail. We do the
best to retain almost the same level of inconsistency detection.
In the test innodb.table_flags, access to one of the tables will not
be blocked despite inconsistent flags.

dict_check_sys_tables(): Remove the problematic assignment, and skip
validation in normal startup.

dict_load_table_one(): If the .ibd file cannot be opened, mark the
table as corrupted and unreadable.

fil_node_open_file(): Validate FSP_SPACE_FLAGS with the expected
flags. If reading the tablespace fails, invalidate node->handle
instead of letting it remain stale. This bug was caught by a
fil_validate() assertion failure.

fsp_flags_try_adjust(): If the tablespace file is invalid, do nothing.
2018-02-12 14:06:04 +02:00
Alexander Barkov
da99e086f9 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-12 10:03:28 +04:00
Sergei Golubchik
49bcc82686 Merge branch '10.1' into 10.2 2018-02-11 13:47:16 +01:00
Alexey Botchkov
b88542681b MDEV-14611 ALTER TABLE EXCHANGE PARTITION does not work properly when used with DATA DIRECTORY.
When table is renamed, the InnoDB's dictionary cache didn't
        change the ib_table->data_dir_path accordingly.
        Now it's set to NULL.
2018-02-10 22:17:49 +04:00
Alexander Barkov
a2feeb3d6f After-merge fixes for "sys_vars.sysvars_innodb '32bit,xtradb'" test results. 2018-02-10 21:51:24 +04:00