mariadb/extra/mariabackup
Marko Mäkelä 3ee1991645 MDEV-36159 mariabackup failed after upgrade
Ever since commit 685d958e38
(MDEV-14425) mariadb-backup --backup had some trouble to keep up
with write workloads of the mariadbd server.

Debarun Banerjee found out that mariadb-backup --backup was
copying the log in the wrong way and not pausing when it made
sense to do so. This change includes his fix as well as some
dead code removal from xtrabackup_copy_mmap_logfile().

Some earlier changes to the default behaviour of mariadb-backup --backup
will be reverted, by making the configuration parameters OFF by default.
These parameters were basically working around this bug:

* commit 652f33e0a4 (MDEV-30000)
introduced --innodb-log-checkpoint-now and made it ON by default.
Making the server execute a log checkpoint can be really I/O intensive.
* commit 6acada713a (MDEV-34062)
introduced --innodb-log-file-mmap and made it ON by default on
Linux and FreeBSD. There are no documented semantics what should
happen to a memory mapping when there are concurrent pwrite(2)
operations by other processes. While it appears to work, it is safer
to default to clearly documented semantics.

xtrabackup_copy_logfile(): Add a parameter early_exit.
Always read a log snippet to the start of recv_sys.buf and assign
recv_sys.len to the read length. We used to shift recv_sys.buf
with memmove(). However, on recv_sys_t::PREMATURE_EOF we cannot know
which part of the mini-transaction was correctly read, because that
part of the ib_logfile0 may be concurrently modified by the server.
So, we will reread everything from the start of the mini-transaction.

xtrabackup_backup_func(): Invoke xtrabackup_copy_logfile(true),
allowing it to stop on every recv_sys_t::PREMATURE_EOF.
This will also avoid repeated "Retry" messages when there is no
more redo log to copy.

get_current_lsn(): Execute FLUSH ENGINE LOGS to ensure that
InnoDB will complete any buffered writes to the ib_logfile0
and ensure that everything up to the current LSN has been
written.

backup_wait_for_commit_lsn(): Wait for as much as is really needed.
This avoids an extra 5-second wait at the end of the backup.

xtrabackup_copy_mmap_logfile(): Remove some dead code, and add
debug assertions to demonstrate that the parser can only return
recv_sys_t::OK or recv_sys_t::GOT_EOF.
2025-08-20 15:30:49 +03:00
..
quicklz MDEV-9566 Add Percona Xtrabackup 2.3.7 2017-04-27 19:12:39 +02:00
aria_backup_client.cc MDEV-36860 exec_REDO_LOGREC_REDO_REPAIR_TABLE: Assertion `maria_tmpdir' failed 2025-05-25 16:38:21 +03:00
aria_backup_client.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_copy.cc MDEV-22250 InnoDB: Failing assertion: opt_no_lock during mariabackup --backup 2025-07-14 16:30:06 +03:00
backup_copy.h MDEV-22250 InnoDB: Failing assertion: opt_no_lock during mariabackup --backup 2025-07-14 16:30:06 +03:00
backup_debug.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_mysql.cc MDEV-36159 mariabackup failed after upgrade 2025-08-20 15:30:49 +03:00
backup_mysql.h Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00
backup_wsrep.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
CMakeLists.txt MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
common.h MDEV-33379 innodb_log_file_buffering=OFF causes corruption on bcachefs 2024-02-20 11:22:45 +02:00
common_engine.cc MDEV-36437 mariabackup - confusing error message when running out of file handles with partitioned MyISAM 2025-03-31 17:57:35 +02:00
common_engine.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
datasink.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
datasink.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ddl_log.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ddl_log.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_buffer.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_buffer.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ds_compress.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_compress.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ds_local.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_local.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ds_stdout.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_stdout.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ds_tmpfile.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_tmpfile.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ds_xbstream.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_xbstream.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
encryption_plugin.cc Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
encryption_plugin.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
fil_cur.cc MDEV-37019 MSAN_STAT_WORKAROUND macro remove 2025-06-18 16:46:21 +10:00
fil_cur.h Merge 10.6 into 10.11 2025-05-21 07:36:35 +03:00
innobackupex.cc MDEV-29445: Reimplement SET GLOBAL innodb_buffer_pool_size 2025-03-26 17:05:44 +02:00
innobackupex.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
read_filt.cc Cleanup: Remove changed_pages_bitmap 2024-02-12 17:01:35 +02:00
read_filt.h Cleanup: Remove changed_pages_bitmap 2024-02-12 17:01:35 +02:00
thread_pool.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
thread_pool.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
write_filt.cc MDEV-36253 Redundant check in wf_incremental_process() 2025-03-10 11:48:18 +05:30
write_filt.h MDEV-31039 mariadb-backup: remove global variables ds_data and ds_meta 2023-04-12 15:14:03 +04:00
wsrep.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xb_regex.h MDEV-14024 PCRE2. 2019-12-21 10:34:02 +01:00
xbcloud.cc Fix few vulnerabilities found by Cppcheck 2023-03-02 14:38:24 +11:00
xbstream.cc Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
xbstream.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xbstream_read.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xbstream_write.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xtrabackup.cc MDEV-36159 mariabackup failed after upgrade 2025-08-20 15:30:49 +03:00
xtrabackup.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00