mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
852d42e993
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 |
||
---|---|---|
.. | ||
quicklz | ||
aria_backup_client.cc | ||
aria_backup_client.h | ||
backup_copy.cc | ||
backup_copy.h | ||
backup_debug.h | ||
backup_mysql.cc | ||
backup_mysql.h | ||
backup_wsrep.h | ||
CMakeLists.txt | ||
common.h | ||
common_engine.cc | ||
common_engine.h | ||
datasink.cc | ||
datasink.h | ||
ddl_log.cc | ||
ddl_log.h | ||
ds_buffer.cc | ||
ds_buffer.h | ||
ds_compress.cc | ||
ds_compress.h | ||
ds_local.cc | ||
ds_local.h | ||
ds_stdout.cc | ||
ds_stdout.h | ||
ds_tmpfile.cc | ||
ds_tmpfile.h | ||
ds_xbstream.cc | ||
ds_xbstream.h | ||
encryption_plugin.cc | ||
encryption_plugin.h | ||
fil_cur.cc | ||
fil_cur.h | ||
innobackupex.cc | ||
innobackupex.h | ||
read_filt.cc | ||
read_filt.h | ||
thread_pool.cc | ||
thread_pool.h | ||
write_filt.cc | ||
write_filt.h | ||
wsrep.cc | ||
xb_regex.h | ||
xbcloud.cc | ||
xbstream.cc | ||
xbstream.h | ||
xbstream_read.cc | ||
xbstream_write.cc | ||
xtrabackup.cc | ||
xtrabackup.h |