MDEV-14992 BACKUP SERVER to mounted file system#4817
Draft
dr-m wants to merge 3 commits into
Draft
Conversation
|
|
2723322 to
1703796
Compare
vuvova
reviewed
Mar 18, 2026
9a529de to
857edeb
Compare
8149b3d to
c08d121
Compare
dr-m
commented
Apr 15, 2026
dr-m
commented
May 19, 2026
dr-m
commented
May 27, 2026
Comment on lines
+223
to
+229
| const lsn_t lsn{log_sys.get_first_lsn()}; | ||
| if (lsn > max_first_lsn && lsn < last_lsn) | ||
| { | ||
| max_first_lsn= lsn; | ||
| log_sys.latch.wr_unlock(); | ||
| bool live_hardlink= false; | ||
| fail= link_or_move(lsn, &live_hardlink); |
Contributor
Author
There was a problem hiding this comment.
At this point, we may have to invoke link_or_move() twice, because the last_lsn may reside outside the log that starts at lsn. In that scenario, it could make sense to wait for the first checkpoint to be completed in the latest log archive file.
log_t::persist(): Move a debug assertion after the point that we are actually about to write to the log. For crash recovery, this function may be invoked in such a way that log_sys.archive disagrees with the format of the log file. Reviewed by: Thirunarayanan Balathandayuthapani
This introduces a basic driver Sql_cmd_backup, storage engine interfaces, and basic copying of InnoDB data files. On Windows, we pass a target directory name; elsewhere, we pass a target directory handle. backup_target: A structured data type to represent a directory or a stream. On Microsoft Windows, we must use directory paths because there is no variant of CopyFileEx() that would work on file handles. copy_entire_file(): A file copying service for POSIX systems. copy_file(): A sparse file-copying service for POSIX systems. backup_context: An InnoDB backup context, attached to trx->lock.backup so that context can exist between InnoDB_backup::end(), which is releasing all locks, and InnoDB_backup::fini() in the same thread, which is expected to finalize the backup without modifying files in the server data directory. fil_space_t::write_or_backup: Keep track of in-flight page writes and pending backup operation. We must not allow them concurrently, because that could lead into torn pages in the backup. fil_space_t::backup_end: The first page number that is not being backed up (by default 0, to indicate that no backup is in progress). TRX_STATE_BACKUP: A special InnoDB transaction state indicating association with BACKUP SERVER, which allows us to pass some context in trx_t from innodb_backup_end() to innodb_backup_finalize(). log_t::backup: Whether BACKUP SERVER is in progress. The purpose of this is to make BACKUP SERVER prevent the concurrent execution of SET GLOBAL innodb_log_archive=OFF or SET GLOBAL innodb_log_file_size when innodb_log_archive=OFF. log_sys.archived_checkpoint: Keep track of the earliest available checkpoint, corresponding to log_sys.archived_lsn. This reflects SET GLOBAL innodb_log_recovery_start (which is settable now), for incremental backup. buf_flush_list_space(): Check for concurrent backup before writing each page. This is inefficient, but this function may be invoked from multiple threads concurrently, and it cannot be changed easily, especially for fil_crypt_thread().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.