Commit graph

340 commits

Author SHA1 Message Date
Marko Mäkelä
5a796f1f41 Merge 10.3 into 10.4 2019-03-08 22:11:37 +02:00
Marko Mäkelä
89b463ee99 Merge 10.2 into 10.3 2019-03-08 22:00:24 +02:00
Marko Mäkelä
ab7e2b048d Merge 10.1 into 10.2 2019-03-08 20:45:45 +02:00
Thirunarayanan Balathandayuthapani
d038806dfe MDEV-18855 Mariabackup should fetch innodb_compression_level from running server
- Fetch innodb_compression_level from the running server.Add the value
of innodb_compression_level in backup-my.cnf file during backup phase.
So that prepare can use the innodb_compression_level variable from
backup-my.cnf
2019-03-08 16:00:08 +05:30
Marko Mäkelä
aa4b2c1509 Merge 10.3 into 10.4 2019-03-07 08:02:33 +02:00
Marko Mäkelä
77103e9832 Merge 10.2 into 10.3 2019-03-06 16:20:13 +02:00
Marko Mäkelä
c155946c90 Merge 10.1 into 10.2 2019-03-06 15:15:59 +02:00
Marko Mäkelä
b761211685 MDEV-18659: Fix string truncation/overflow in InnoDB and XtraDB
Fix the warnings issued by GCC 8 -Wstringop-truncation
and -Wstringop-overflow in InnoDB and XtraDB.

This work is motivated by Jan Lindström. The patch mainly differs
from his original one as follows:

(1) We remove explicit initialization of stack-allocated string buffers.
The minimum amount of initialization that is needed is a terminating
NUL character.
(2) GCC issues a warning for invoking strncpy(dest, src, sizeof dest)
because if strlen(src) >= sizeof dest, there would be no terminating
NUL byte in dest. We avoid this problem by invoking strncpy() with
a limit that is 1 less than the buffer size, and by always writing
NUL to the last byte of the buffer.
(3) We replace strncpy() with memcpy() or strcpy() in those cases
when the result is functionally equivalent.

Note: fts_fetch_index_words() never deals with len==UNIV_SQL_NULL.
This was enforced by an assertion that limits the maximum length
to FTS_MAX_WORD_LEN. Also, the encoding that InnoDB uses for
the compressed fulltext index is not byte-order agnostic, that is,
InnoDB data files that use FULLTEXT INDEX are not portable between
big-endian and little-endian systems.
2019-03-06 11:22:27 +02:00
Marko Mäkelä
2a791c53ad Merge 10.3 into 10.4 2019-03-06 09:00:52 +02:00
Marko Mäkelä
a2fc36989e Merge 10.2 into 10.3 2019-03-04 17:01:00 +02:00
Oleksandr Byelkin
93ac7ae70f Merge branch '10.3' into 10.4 2019-02-21 14:40:52 +01:00
Vladislav Vaintroub
945c748adc MDEV-18669 mariabackup writes timestamp in version line
Use fprintf(stderr) instead of msg() to print the version line
2019-02-21 00:06:08 +01:00
Vladislav Vaintroub
39a2984dc0 Revert "MDEV-18575 Cleanup : remove innodb-encrypt-log parameter from mariabackup"
This reverts commit 3262967008.
It was checked in by mistake
2019-02-20 17:22:44 +01:00
Thirunarayanan Balathandayuthapani
c0f47a4a58 MDEV-12026: Implement innodb_checksum_algorithm=full_crc32
MariaDB data-at-rest encryption (innodb_encrypt_tables)
had repurposed the same unused data field that was repurposed
in MySQL 5.7 (and MariaDB 10.2) for the Split Sequence Number (SSN)
field of SPATIAL INDEX. Because of this, MariaDB was unable to
support encryption on SPATIAL INDEX pages.

Furthermore, InnoDB page checksums skipped some bytes, and there
are multiple variations and checksum algorithms. By default,
InnoDB accepts all variations of all algorithms that ever existed.
This unnecessarily weakens the page checksums.

We hereby introduce two more innodb_checksum_algorithm variants
(full_crc32, strict_full_crc32) that are special in a way:
When either setting is active, newly created data files will
carry a flag (fil_space_t::full_crc32()) that indicates that
all pages of the file will use a full CRC-32C checksum over the
entire page contents (excluding the bytes where the checksum
is stored, at the very end of the page). Such files will always
use that checksum, no matter what the parameter
innodb_checksum_algorithm is assigned to.

For old files, the old checksum algorithms will continue to be
used. The value strict_full_crc32 will be equivalent to strict_crc32
and the value full_crc32 will be equivalent to crc32.

ROW_FORMAT=COMPRESSED tables will only use the old format.
These tables do not support new features, such as larger
innodb_page_size or instant ADD/DROP COLUMN. They may be
deprecated in the future. We do not want an unnecessary
file format change for them.

The new full_crc32() format also cleans up the MariaDB tablespace
flags. We will reserve flags to store the page_compressed
compression algorithm, and to store the compressed payload length,
so that checksum can be computed over the compressed (and
possibly encrypted) stream and can be validated without
decrypting or decompressing the page.

In the full_crc32 format, there no longer are separate before-encryption
and after-encryption checksums for pages. The single checksum is
computed on the page contents that is written to the file.

We do not make the new algorithm the default for two reasons.
First, MariaDB 10.4.2 was a beta release, and the default values
of parameters should not change after beta. Second, we did not
yet implement the full_crc32 format for page_compressed pages.
This will be fixed in MDEV-18644.

This is joint work with Marko Mäkelä.
2019-02-19 18:50:19 +02:00
Marko Mäkelä
fc124778ea Merge 10.2 into 10.3 2019-02-19 17:41:13 +02:00
Marko Mäkelä
ca76fc4a3a MDEV-18611: mariabackup silently ended during xtrabackup_copy_logfile()
log_group_read_log_seg(): Always return false when returning
before reading end_lsn.

xtrabackup_copy_logfile(): On error, indicate whether
a corrupt log record was encountered.

Only xtrabackup_copy_logfile() in Mariabackup cared about the
return value of the function. InnoDB crash recovery was not
affected by this bug.
2019-02-19 11:14:03 +02:00
Vladislav Vaintroub
d2fc9d09da MDEV-18204 - fixup 2019-02-19 07:31:25 +01:00
Vladislav Vaintroub
3a42926c88 MDEV-18204 Fix rocksdb incremental backup
Fix incremental prepare to copy #rocksdb subdirectory from the
incremental dir.
2019-02-18 18:59:05 +01:00
Vladislav Vaintroub
282ba973e7 MDEV-18549 Failing assertion: opt_no_lock during mariabackup --backup
The assertion happens under BACKUP STAGE BLOCK_COMMIT, when a DDL on a
temporary table (#sql-xxx) is found.

Apparently, assumption that all DDLs are blocked under FTWRL does not
hold for BACKUP STAGE, and temporary tables can still have ALTERs

The fix is to relax the assertion, and only check for opt_no_lock if
backup is *really* inconsistent, i.e either optimized DDL or CREATE/RENAME
are done on the tables that were not skipped during backup.
2019-02-14 20:18:34 +01:00
Vladislav Vaintroub
40b4f9c907 MDEV-18575 remove innodb-encrypt-log parameter from mariabackup
The variable is obsolete.
In mariabackup --backup, encryption plugin loading code sets the value
this parameter to the same as in server.

In mariabackup --prepare, no new redo  log is generated,
and xtrabackup_logfile is removed after it anyway.
2019-02-14 11:54:34 +01:00
Vladislav Vaintroub
3262967008 MDEV-18575 Cleanup : remove innodb-encrypt-log parameter from mariabackup 2019-02-14 11:11:16 +01:00
Marko Mäkelä
0a1c3477bf MDEV-18493 Remove page_size_t
MySQL 5.7 introduced the class page_size_t and increased the size of
buffer pool page descriptors by introducing this object to them.

Maybe the intention of this exercise was to prepare for a future
where the buffer pool could accommodate multiple page sizes.
But that future never arrived, not even in MySQL 8.0. It is much
easier to manage a pool of a single page size, and typically all
storage devices of an InnoDB instance benefit from using the same
page size.

Let us remove page_size_t from MariaDB Server. This will make it
easier to remove support for ROW_FORMAT=COMPRESSED (or make it a
compile-time option) in the future, just by removing various
occurrences of zip_size.
2019-02-07 12:21:35 +02:00
Marko Mäkelä
e80bcd7f64 Merge 10.3 into 10.4 2019-02-05 12:48:02 +02:00
Marko Mäkelä
ab2458c61f Merge 10.2 into 10.3 2019-02-04 15:12:14 +02:00
Marko Mäkelä
081fd8bfa2 Merge 10.1 into 10.2 2019-02-02 11:40:02 +02:00
Vladislav Vaintroub
a2641b2611 MDEV-18380 : adjust max_statement_time in mariabackup 2019-02-01 08:53:50 +02:00
Thirunarayanan Balathandayuthapani
f669cecbe3 MDEV-18415 mariabackup.mdev-14447 test case fails with Table 'test.t' doesn't exist in engine
- Added retry logic if validation of first page fails with checksum
mismatch.
2019-02-01 08:53:50 +02:00
Vladislav Vaintroub
6e2af7d084 mariabackup : Remove unused parameter innodb_buffer_pool_size 2019-01-30 09:31:32 +01:00
Marko Mäkelä
78829a5780 Merge 10.3 into 10.4 2019-01-24 22:42:35 +02:00
Marko Mäkelä
947b6b849d Merge 10.2 into 10.3 2019-01-24 16:14:12 +02:00
Geoff Montee
f17c284c57 MDEV-18347: mariabackup doesn't read all server option groups from configuration files 2019-01-24 12:44:55 +01:00
Vladislav Vaintroub
5c159c9037 MDEV-18356 Renamed backup-encrypted option introduced in 7158edcba3
Rename it because it caused parser warning whenever --backup was used.
2019-01-23 12:09:02 +00:00
Brave Galera Crew
36a2a185fe Galera4 2019-01-23 15:30:00 +04:00
Marko Mäkelä
9dc81d2a7a Merge 10.3 into 10.4 2019-01-17 13:21:27 +02:00
Marko Mäkelä
77cbaa96ad Merge 10.2 into 10.3 2019-01-17 12:38:46 +02:00
Vladislav Vaintroub
2153aaf66e mariabackup : use die() macro for fatal exit with error message. 2019-01-16 08:39:49 +01:00
Vladislav Vaintroub
a8a27e65a8 MDEV-18212 mariabackup: Make output format uniform whenever possible 2019-01-15 14:15:04 +01:00
Marko Mäkelä
55a0c3eb6d Merge 10.3 into 10.4 2019-01-15 12:30:29 +02:00
Vladislav Vaintroub
32bb579192 replace hardcoded string "#sql" with tmp_file_prefix 2019-01-14 14:43:24 +01:00
Vladislav Vaintroub
24bc8edcc5 MDEV-18184 Do not copy temporary files (prefixed with #sql-) to backup 2019-01-14 14:25:08 +01:00
Marko Mäkelä
efb510462e Merge 10.2 into 10.3 2019-01-14 14:55:50 +02:00
Marko Mäkelä
248dc12e60 Merge 10.1 into 10.2 2019-01-14 11:37:51 +02:00
FaramosCZ
7372fe4da1 xb_process_datadir(): Fix resource leaks
Closes #983, #984
2019-01-14 11:02:04 +02:00
Vladislav Vaintroub
7331c661db MDEV-18201 : mariabackup- fix processing of rename/create sequence in prepare
Fix one more bug in "DDL redo" phase in prepare
If table was renamed, and then new table was created with the old name,
prepare can be confused, and .ibd can end up with wrong name.

Fix the order of how DDL fixup is applied , once again - ".new" files
should be processed after renames.
2019-01-10 19:35:45 +01:00
Vladislav Vaintroub
4a872ae1e7 MDEV-18185 - mariabackup - fix specific case of table rename handing in prepare.
If, during backup
1) Innodb table is dropped (after being copied to backup) and then
2) Before backup finished, another Innodb table is renamed, and new name
is the name of the dropped table in 1)

then, --prepare fails with assertion, as DDL fixup code in prepare
did not handle this specific case.

The fix is to process drops before renames, in prepare DDL-"redo" phase.
2019-01-09 22:28:31 +01:00
Marko Mäkelä
734510a44d Merge 10.3 into 10.4 2019-01-06 17:43:02 +02:00
Marko Mäkelä
dd43c85c48 Merge 10.2 into 10.3 2019-01-04 02:06:41 +02:00
Marko Mäkelä
23e4446adc Fix a merge error in the parent commit
Fix an inadvertently inverted condition that caused
galera.galera_sst_mariabackup_table_options test failure.
2019-01-04 01:59:46 +02:00
Marko Mäkelä
94e22efb79 Merge 10.2 into 10.3 2019-01-03 17:26:50 +02:00
Marko Mäkelä
b7392d142a Merge 10.1 into 10.2 2019-01-03 16:58:05 +02:00