mariadb/extra/mariabackup
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
..
quicklz
aria_backup_client.cc Fix a typo which lead to compiler error on 32 bit systems 2024-04-09 17:11:49 +02:00
aria_backup_client.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_copy.cc MDEV-34483 Backup may copy unnecessarily much log 2024-09-09 16:47:35 +03:00
backup_copy.h MDEV-32932 fix comments to match the code 2024-04-22 15:27:14 +02:00
backup_debug.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_mysql.cc Merge branch '10.6' into 10.11 2024-07-22 15:14:50 +02:00
backup_mysql.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
backup_wsrep.h
CMakeLists.txt MDEV-33447: libpmem is not available in RHEL 8 2024-04-19 10:54:08 +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-32932 Port backup features from ES 2024-02-27 20:55:54 +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
ds_compress.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_compress.h
ds_local.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_local.h
ds_stdout.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_stdout.h
ds_tmpfile.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_tmpfile.h
ds_xbstream.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
ds_xbstream.h
encryption_plugin.cc Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
encryption_plugin.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
fil_cur.cc Merge branch '10.6' into 10.11 2024-04-26 08:02:49 +02:00
fil_cur.h Merge 10.6 into 10.11 2024-02-14 16:12:53 +02:00
innobackupex.cc Give warnings if one tries to use obsolete options with mariadb-backup 2024-02-27 20:55:54 +02:00
innobackupex.h
read_filt.cc
read_filt.h
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-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
write_filt.h
wsrep.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00
xb_regex.h
xbcloud.cc
xbstream.cc MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +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-34483 Backup may copy unnecessarily much log 2024-09-09 16:47:35 +03:00
xtrabackup.h MDEV-32932 Port backup features from ES 2024-02-27 20:55:54 +02:00