mariadb/extra
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
..
aws_sdk MDEV-30831 Cannot compile AWS KMS Plugin 2025-06-10 15:18:28 +02:00
mariabackup MDEV-36159 mariabackup failed after upgrade 2025-08-20 15:30:49 +03:00
readline Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
wolfssl Workaround WolfSSL issue #9004 to fix the build on Windows. 2025-07-25 12:28:30 +02:00
charset2html.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
CMakeLists.txt MDEV-36316/MDEV-36327/MDEV-36328 Debug msan 2025-05-28 16:28:34 +10:00
comp_err.c MDEV-30810 errmsg-utf8.txt no longer uses charsets 2023-03-10 08:53:58 +11:00
innochecksum.cc Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
my_print_defaults.c Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
mysql_waitpid.c Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00
mysqld_safe_helper.c mysqld_safe_help - remove warning 2017-04-30 15:06:01 +04:00
perror.c MDEV-34714 perror-win test failure on localized Windows 2024-08-09 01:15:45 +02:00
replace.c Merge 10.4 into 10.5 2022-07-01 14:42:02 +03:00
resolve_stack_dump.c MDEV-22189: Change error messages inside code to have mariadb instead of 2021-05-24 11:38:13 +05:30
resolveip.c Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00