Commit graph

177811 commits

Author SHA1 Message Date
Vladislav Vaintroub
c5a525bda2 mariabackup : debian packaging 2017-07-05 11:05:35 +00:00
Marko Mäkelä
e417af2cb8 MDEV-13143 Server crashes in srv_init_abort_low() when started with inaccessible tmpdir
This is a regression caused by
commit bb60a832ed

srv_shutdown_all_bg_threads(): If os_thread_count indicates that
no threads are running, do not bother checking thread status.
This avoids a crash when InnoDB startup is aborted before
os_aio_init() has been invoked. (os_aio_all_slots_free() would
dereference AIO::s_reads even though it is NULL.)
2017-07-05 12:45:15 +03:00
Marko Mäkelä
8c71c6aa8b MDEV-12548 Initial implementation of Mariabackup for MariaDB 10.2
InnoDB I/O and buffer pool interfaces and the redo log format
have been changed between MariaDB 10.1 and 10.2, and the backup
code has to be adjusted accordingly.

The code has been simplified, and many memory leaks have been fixed.
Instead of the file name xtrabackup_logfile, the file name ib_logfile0
is being used for the copy of the redo log. Unnecessary InnoDB startup and
shutdown and some unnecessary threads have been removed.

Some help was provided by Vladislav Vaintroub.

Parameters have been cleaned up and aligned with those of MariaDB 10.2.

The --dbug option has been added, so that in debug builds,
--dbug=d,ib_log can be specified to enable diagnostic messages
for processing redo log entries.

By default, innodb_doublewrite=OFF, so that --prepare works faster.
If more crash-safety for --prepare is needed, double buffering
can be enabled.

The parameter innodb_log_checksums=OFF can be used to ignore redo log
checksums in --backup.

Some messages have been cleaned up.
Unless --export is specified, Mariabackup will not deal with undo log.
The InnoDB mini-transaction redo log is not only about user-level
transactions; it is actually about mini-transactions. To avoid confusion,
call it the redo log, not transaction log.

We disable any undo log processing in --prepare.

Because MariaDB 10.2 supports indexed virtual columns, the
undo log processing would need to be able to evaluate virtual column
expressions. To reduce the amount of code dependencies, we will not
process any undo log in prepare.

This means that the --export option must be disabled for now.

This also means that the following options are redundant
and have been removed:
	xtrabackup --apply-log-only
	innobackupex --redo-only

In addition to disabling any undo log processing, we will disable any
further changes to data pages during --prepare, including the change
buffer merge. This means that restoring incremental backups should
reliably work even when change buffering is being used on the server.
Because of this, preparing a backup will not generate any further
redo log, and the redo log file can be safely deleted. (If the
--export option is enabled in the future, it must generate redo log
when processing undo logs and buffered changes.)

In --prepare, we cannot easily know if a partial backup was used,
especially when restoring a series of incremental backups. So, we
simply warn about any missing files, and ignore the redo log for them.

FIXME: Enable the --export option.

FIXME: Improve the handling of the MLOG_INDEX_LOAD record, and write
a test that initiates a backup while an ALGORITHM=INPLACE operation
is creating indexes or rebuilding a table. An error should be detected
when preparing the backup.

FIXME: In --incremental --prepare, xtrabackup_apply_delta() should
ensure that if FSP_SIZE is modified, the file size will be adjusted
accordingly.
2017-07-05 11:43:28 +03:00
Marko Mäkelä
dc722559cc Correct a message 2017-07-05 10:16:36 +03:00
Marko Mäkelä
15c73c8b4a Flush crash-unsafe tables before killing the server 2017-07-05 10:08:48 +03:00
Marko Mäkelä
6eb1ce048e Adjust a test for tmp_disk_table_size
The parameter was recently introduced in
commit dd8474b1dc
but this test was not adjusted accordingly.
2017-07-05 08:07:16 +03:00
Marko Mäkelä
41a6475b49 InnoDB: Use access() instead of open() 2017-07-05 08:02:55 +03:00
Daniel Bartholomew
8ae9c86f2a bump the VERSION 2017-07-04 10:26:14 -04:00
Sachin
06041ade9a Merge pull request #397 from MariaDB/bb-10.2-MDEV-12067
MDEV-12067 flashback does not correcly revert update/replace statements
2017-07-04 16:14:12 +05:30
Marko Mäkelä
ad2d722acd MDEV-13228: Add a comment that clarifies the constants 2017-07-03 13:13:54 +03:00
Marko Mäkelä
d438a448e6 MDEV-13228 Assertion `n < rec_offs_n_fields(offsets)' failed in rec_get_nth_field_offs upon crash recovery with compressed table
In my preparatory patch for MDEV-12288, there was an off-by-one
array initialization error that affected debug builds.
2017-07-03 12:17:10 +03:00
Marko Mäkelä
56ff6f1b0b InnoDB: Remove dead code for DATA_POINT and DATA_VAR_POINT
The POINT data type is being treated just like any other
geometry data type in InnoDB. The fixed-length data type
DATA_POINT had been introduced in WL#6942 based on a
misunderstanding and without appropriate review.
Because of fundamental design problems (such as a
DEFAULT POINT(0 0) value secretly introduced by InnoDB),
the code was disabled in Oracle Bug#20415831 fix.

This patch removes the dead code and definitions that were
left behind by the Oracle Bug#20415831 patch.
2017-07-03 12:17:10 +03:00
Marko Mäkelä
cf2789bf0b ha_innobase::write_row(): Test the cheaper condition first 2017-07-03 12:17:00 +03:00
Monty
f8dadbdf24 Ensure that we have LOG_log locked when relay_log.close is called
If open of the relay log failed, we got an assert in MYSQL_BIN_LOG::close
This only affected DEBUG systems
2017-07-03 11:16:13 +03:00
Kristian Nielsen
228479a28c MDEV-8075: DROP TEMPORARY TABLE not marked as ddl, causing optimistic parallel replication to fail
CREATE/DROP TEMPORARY TABLE are not safe to optimistically replicate in
parallel with other transactions, so they need to be marked as "ddl" in the
binlog.

This was already done for stand-alone CREATE/DROP TEMPORARY. But temporary
tables can also be created and dropped inside a BEGIN...END transaction, and
such transactions were not marked as ddl. Nor was the DROP TEMPORARY TABLE
statement emitted implicitly when a client connection is closed.

So this patch adds such ddl mark for the missing cases.

The difference to Kristian's original patch is mainly a fix in
mysql_trans_commit_alter_copy_data() to remember the unsafe_rollback_flags
over the temporary commit.
2017-07-03 11:16:13 +03:00
Lixun Peng
007d3ed905 MDEV-12067 flashback does not correcly revert update/replace statements
Problem
-------
For one-statement contains multiple row events, Flashback didn't reverse the
sequence of row events inside one-statement.

Solution
--------
Using a new array 'events_in_stmt' to store the row events of one-statement,
when parsed the last one event, then print from the last one to the first one.

In the same time, fixed another bug, without -vv will not insert the table_map
into print_event_info->m_table_map, then change_to_flashback_event() will not
execute because of Table_map_log_event is empty.
2017-07-03 14:48:07 +08:00
Elena Stepanova
da7604a294 Latest additions to the list of unstable tests in 10.1.25 2017-07-01 21:12:26 +03:00
Monty
92f1837a27 Fixed compilation warnings (while testing 32 bit builds) 2017-07-01 14:26:42 +03:00
Monty
cc8912f223 Fixed failing test on 32 bit systems 2017-07-01 14:26:42 +03:00
Monty
3833097463 Clean up BUILD script
- Removed some not old, not used build scipts
- Removed tokudb and rocksdb from 32 bit builds
  This enables one now to easily build 32 bit binaries
  on 64 bit systems
2017-07-01 14:26:42 +03:00
Monty
2e9b55f763 MDEV-13226 Server crashes when tmpdir runs out of space
There was a missing test in CTE handling if creating a temporary table
failed (in this case as a result of out of space). This caused a table
handler to be used even if it was not allocated.
2017-07-01 14:26:42 +03:00
Marko Mäkelä
c436338d9d Assert that DB_TRX_ID must be set on delete-marked records
This is preparation for MDEV-12288, which would set DB_TRX_ID=0
when purging history. Also with that change in place, delete-marked
records must always refer to an undo log record via a nonzero
DB_TRX_ID column. (The DB_TRX_ID is only present in clustered index
leaf page records.)

btr_cur_parse_del_mark_set_clust_rec(), rec_get_trx_id():
Statically allocate the offsets
(should never use the heap). Add some debug assertions.

Replace some use of rec_get_trx_id() with row_get_rec_trx_id().

trx_undo_report_row_operation(): Add some sanity checks that are
common for all operations that produce undo log.
2017-07-01 11:02:58 +03:00
Jacob Mathew
806d4e3127 Run spider mtr suites in 10.1 only on demand. 2017-06-30 16:17:29 -07:00
Jacob Mathew
53235cbb1f Updated spider/bg and spider/handler mtr suites. 2017-06-30 14:58:05 -07:00
Monty
f99b83571a Added submodule updates to BUILD scripts 2017-06-30 22:33:28 +03:00
Monty
a2d5bd96bf Fixed wrong results in show_all_plugins.test
- Crude hack to get it to work. Hope Serg has a better solution at some point..
2017-06-30 22:33:28 +03:00
Monty
b356eae8a9 Don't create tags for .xz files 2017-06-30 22:31:37 +03:00
Monty
dd8474b1dc Added tmp_disk_table_size to limit size of Aria temp tables in tmpdir
- Added variable tmp_disk_table_size
- Added variable tmp_memory_table_size as an alias for tmp_table_size
- Changed internal variable tmp_table_size to tmp_memory_table_size
- create_info.data_file_length is now set with tmp_disk_table_size
- Fixed that Aria doesn't reset max_data_file_length for internal tables
- Added status flag if table is full so that we can detect this on next insert.
  This ensures that the table is always 'correct', but we get the error one
  row after the row that grow the table too big.
- Removed some mutex lock for internal temporary tables
2017-06-30 22:31:37 +03:00
Monty
9f484b63f1 Clean up replication check in open_temporary_table() 2017-06-30 22:31:37 +03:00
Marko Mäkelä
e16425ba97 Fix a compiler warning 2017-06-30 18:50:30 +03:00
Marko Mäkelä
ebe4c65e1d Enable more variants of some innodb_zip tests 2017-06-30 18:43:48 +03:00
Marko Mäkelä
f27e1a318c Remove duplicated tests 2017-06-30 18:40:36 +03:00
Vladislav Vaintroub
4877659006 MDEV-12097 : avoid too large memory allocation in innodb buffer pool
on Windows

Align innodb_pool_size up to the innodb_buf_pool_chunk_unit.
2017-06-30 15:35:43 +00:00
Sergei Golubchik
d38b15de65 Merge branch '10.0-galera' into 10.1 2017-06-30 16:33:13 +02:00
Marko Mäkelä
bf262bd957 MDEV-11649 Uninitialized field fts_token->position in innodb_fts.innodb_fts_plugin
The field fts_token->position is not initialized in
row_merge_fts_doc_tokenize(). We cannot have that field
without changing the fulltext parser plugin ABI
(adding st_mysql_ftparser_boolean_info::position,
as it was done in MySQL 5.7 in WL#6943).

The InnoDB fulltext parser plugins "ngram" and "Mecab" that were
introduced in MySQL 5.7 do depend on that field. But the simple_parser
does not. Apparently, simple_parser is leaving the field as 0.

So, in our fix we will assume that the missing position field is 0.
2017-06-30 15:03:53 +03:00
Marko Mäkelä
dd75087993 Fix a compilation warning 2017-06-30 15:03:01 +03:00
Sergei Golubchik
d3cc15eb82 Merge branch '10.0' into 10.1 2017-06-30 13:28:39 +02:00
Sergei Golubchik
b503b1c0ed MDEV-11646 main.myisam, maria.maria, main.mix2_myisam, main.myisampack, main.mrr_icp_extra fail in buildbot with valgrind (Syscall param pwrite64(buf) points to uninitialised byte(s))
If the table has a varchar column and a forced fixed for format
(as in varchar.inc), Field_varstring::store() will only store the
actual number of bytes, not padded, in the record[0].

That is, on inserts a part of record[0] can be uninitialized.

Fix: initialize record[0] when a TABLE is created, it doesn't matter
what kind of garbage can be in this unused/invisible part of the
record, as long as it's not some random memory contents
(that can contain sensitive data).
2017-06-30 13:28:28 +02:00
Marko Mäkelä
a1e51e7f47 Mariabackup: Test file cleanup 2017-06-30 11:35:28 +03:00
Marko Mäkelä
4fe89773d8 Mariabackup: Clean up xtrabackup options
Fix the binding of databases_file. It was incorrectly mapped
to OPT_XTRA_TABLES_FILE.

Remove some unused options and variables.
2017-06-30 11:35:28 +03:00
Sergei Golubchik
273e0f663e MDEV-13179 main.errors fails in buildbot and outside with wrong errno 1290 2017-06-30 10:28:01 +02:00
Marko Mäkelä
61847b9d80 Tablespace: Add iterator, const_iterator, begin(), end() 2017-06-30 09:31:19 +03:00
Marko Mäkelä
5ad4645779 Adjust a test for the changed innodb_log_file_size limits 2017-06-30 09:25:39 +03:00
Igor Babaev
9f0c1c0cf6 Fixed the bug mdev-13193.
When an equality that can be pushed into a materialized derived
table / view is extracted from multiple equalities and their
operands are cloned then if they have some pointers to Item_equal
objects those pointers must be set to NULL in the clones. Anyway
they are not valid in the pushed predicates.
2017-06-29 20:50:26 -07:00
Sergei Golubchik
92928bcdd9 Merge branch '5.5' into 10.0 2017-06-29 23:32:18 +02:00
Marko Mäkelä
84e4e4506f Reduce the granularity of innodb_log_file_size
In Mariabackup, we would want the backed-up redo log file size to be
a multiple of 512 bytes, or OS_FILE_LOG_BLOCK_SIZE. However, at startup,
InnoDB would be picky, requiring the file size to be a multiple of
innodb_page_size.

Furthermore, InnoDB would require the parameter to be a multiple of
one megabyte, while the minimum granularity is 512 bytes. Because
the data-file-oriented fil_io() API is being used for writing the
InnoDB redo log, writes will for now require innodb_log_file_size to
be a multiple of the maximum innodb_page_size (65536 bytes).

To complicate matters, InnoDB startup divided srv_log_file_size by
UNIV_PAGE_SIZE, so that initially, the unit was bytes, and later it
was innodb_page_size. We will simplify this and keep srv_log_file_size
in bytes at all times.

innobase_log_file_size: Remove. Remove some obsolete checks against
overflow on 32-bit systems. srv_log_file_size is always 64 bits, and
the maximum size 512GiB in multiples of innodb_page_size always fits
in ulint (which is 32 or 64 bits). 512GiB would be 8,388,608*64KiB or
134,217,728*4KiB.

log_init(): Remove the parameter file_size that was always passed as
srv_log_file_size.

log_set_capacity(): Add a parameter for passing the requested file size.

srv_log_file_size_requested: Declare static in srv0start.cc.

create_log_file(), create_log_files(),
innobase_start_or_create_for_mysql(): Invoke fil_node_create()
with srv_log_file_size expressed in multiples of innodb_page_size.

innobase_start_or_create_for_mysql(): Require the redo log file sizes
to be multiples of 512 bytes.
2017-06-29 23:15:05 +03:00
Marko Mäkelä
e903d458bb Clean up InnoDB shutdown
Tablespace::shutdown(): Clear m_path. This was moved from
Tablespace::~Tablespace().

LatchDebug::shutdown(): Remove a redundant condition.
2017-06-29 23:10:46 +03:00
Marko Mäkelä
591edccc93 Simplify access to the binlog offset in InnoDB
trx_sys_print_mysql_binlog_offset(): Use 64-bit arithmetics and ib::info().

TRX_SYS_MYSQL_LOG_OFFSET: Replaces TRX_SYS_MYSQL_LOG_OFFSET_HIGH,
TRX_SYS_MYSQL_LOG_OFFSET_LOW.

trx_sys_update_mysql_binlog_offset(): Remove the constant parameter
field=TRX_SYS_MYSQL_LOG_INFO. Use 64-bit arithmetics.
2017-06-29 23:03:39 +03:00
Marko Mäkelä
aea0e125d2 trx_sys_read_wsrep_checkpoint(): Return whether a checkpoint is present 2017-06-29 23:01:47 +03:00
Marko Mäkelä
cd623508df buf_read_ibuf_merge_pages(): Discard all entries for a missing tablespace
A similar change was contributed to Percona XtraBackup, but for some
reason, it is not present in Percona XtraDB. Since MDEV-9566
(MariaDB 10.1.23), that change is present in the MariaDB XtraDB.
2017-06-29 22:39:06 +03:00