mariadb/extra
Marko Mäkelä 852d42e993 MDEV-34483 Backup may copy unnecessarily much log
In mariadb-backup --backup there are multiple mechanisms for ensuring that
a sufficient amount of the InnoDB write-ahead log (ib_logfile0) is being
copied at the end of the backup. The backup needs to include the latest
committed transaction. While further transaction commits are blocked by
BACKUP STAGE BLOCK_COMMIT, ongoing transactions may modify the database
contents and write log records. We were unnecessarily copying such log,
which would also cause further effort of rolling back incomplete
transactions after the backup is restored.

backup_wait_for_lsn(): Declare as static, and refactor some code
to separate functions backup_wait_for_lsn_low() and
backup_wait_timeout().

backup_wait_for_commit_lsn(): A new function to determine the current
LSN (within BACKUP STAGE BLOCK_COMMIT) and to wait for the log to be
copied until that. Invoked by BackupStages::stage_block_commit().

xtrabackup_backup_func(): Remove a condition that had already been
checked by a caller of backup_wait_timeout().

server_lsn_after_lock: Declare as a local variable in
BackupStages::stage_block_ddl().

log_copying_thread(), io_watching_thread(): Use metadata_last_lsn
instead of metadata_to_lsn as the stop condition.

BackupStages::stage_block_commit(): Ensure that the log tables
(in particular, mysql.general_log) will have been copied before
the BACKUP STAGE BLOCK_COMMIT is being followed by any further
SQL statements.

Reviewed by: Debarun Banerjee
Tested by: Matthias Leich
2024-09-09 16:47:35 +03:00
..
aws_sdk MDEV-23539: aws key plugin - fails to build 2020-10-26 14:59:42 +11:00
mariabackup MDEV-34483 Backup may copy unnecessarily much log 2024-09-09 16:47:35 +03:00
readline Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
wolfssl New wolfssl v5.7.2-stable 2024-07-15 19:11:39 +02:00
charset2html.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
CMakeLists.txt Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
comp_err.c MDEV-30810 errmsg-utf8.txt no longer uses charsets 2023-03-10 08:53:58 +11:00
innochecksum.cc Merge branch '10.9' into 10.10 2023-08-05 20:34:09 +02:00
my_print_defaults.c Merge 10.6 into 10.11 2023-12-20 15:58:36 +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
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