Skip to content

Commit 13ca654

Browse files
alisonfelEvergreen Agent
authored andcommitted
Import wiredtiger: d2a6f8ba360b1c36405666ff471352320c4583fb from branch mongodb-master
ref: dcb3808c92..d2a6f8ba36 for: 5.1.0 WT-7007 Backup architecture guide page
1 parent feded38 commit 13ca654

File tree

5 files changed

+79
-1
lines changed

5 files changed

+79
-1
lines changed

src/third_party/wiredtiger/dist/docs_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ def __init__(self, doxygen_name, data_structures, files):
1111
# List of all architecture subsections
1212
##########################################
1313
arch_doc_pages = [
14+
ArchDocPage('arch-backup',
15+
['WT_CURSOR_BACKUP'],
16+
['src/cursor/cur_backup.c', 'src/cursor/cur_backup_incr.c']),
1417
ArchDocPage('arch-block',
1518
['WT_BLOCK', 'WT_BLOCK_CKPT', 'WT_BLOCK_DESC', 'WT_BLOCK_HEADER',
1619
'WT_BM', 'WT_EXTLIST'],

src/third_party/wiredtiger/import.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"vendor": "wiredtiger",
33
"github": "wiredtiger/wiredtiger.git",
44
"branch": "mongodb-master",
5-
"commit": "dcb3808c928c50c20e8ea46bb44609986d58c75d"
5+
"commit": "d2a6f8ba360b1c36405666ff471352320c4583fb"
66
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*! @arch_page arch-backup Backup
2+
3+
# Overview #
4+
5+
Backup in WiredTiger can be performed using the \c "backup:" cursor. WiredTiger
6+
supports four types of backups.
7+
8+
1. Full database
9+
2. Block-based incremental backup
10+
3. Log-based incremental backup
11+
4. Target backup
12+
13+
The following page describes how backup works inside the WiredTiger. Please refer to
14+
@ref backup for details on how to use each of these types of backups.
15+
16+
# Full database #
17+
18+
When the application opens the backup cursor, internally WiredTiger generates a list of all
19+
files in the database that are necessary for the backup. WiredTiger takes both the checkpoint
20+
and schema locks to block database file modifications while generating the list files. There
21+
is a contract that all files that exist at the time the backup starts exist for the entire time
22+
the backup cursor is open. This contract applies to all files in the database, not just files
23+
that are included in the generated list.
24+
25+
WiredTiger log files are also part of the generated file list for backup. There is a contract
26+
that the log files do not contain or make visible operations that are added to the log after
27+
the backup started that could have adverse affects during recovery and restore. Therefore
28+
WiredTiger forces a log file switch when opening the backup cursor. To fulfill the earlier
29+
contract that all files must exist during backup, WiredTiger does not use any pre-allocated
30+
log files nor does it archive or remove old log files during the time the backup cursor is open.
31+
32+
Once the backup is opened successfully, any checkpoints that exist on the database before
33+
backup starts must be retained until the backup cursor is closed. All the newer checkpoints
34+
that are created during the backup in progress are cleaned whenever a newer checkpoint is
35+
created.
36+
37+
# Block-based incremental backup #
38+
39+
Block-based incremental backup is performed by tracking the modified blocks in the checkpoint.
40+
Whenever a new checkpoint occurs on a file, any new or modified blocks in this checkpoint are
41+
recorded as a bit string. This bit string information is updated with every new checkpoint.
42+
43+
Whenever the incremental backup cursor is opened to perform the backup, WiredTiger returns all
44+
the file offsets and sizes that are modified from the previous source backup identifier.
45+
WiredTiger returns the full file information to be copied for all the new files that are created,
46+
renamed or imported into the database after the incremental backup cursor is opened. Refer to
47+
@ref backup_incremental-block for more information on how to use the block-based incremental backup.
48+
49+
# Log-based incremental backup #
50+
51+
When the backup cursor is opened with the \c target configuration string as \c "target=(\"log:\\")"
52+
the log-based incremental backup is performed by adding all the existing log files in the database
53+
to the list of files that needs to be copied. Applications wanting to use log files for incremental
54+
backup must first disable automatic log file removal using the \c log=(archive=false) configuration
55+
to ::wiredtiger_open. By default, WiredTiger automatically removes log files no longer required
56+
for recovery. Refer to @ref backup_incremental for more information on how to use the log-based
57+
incremental backup.
58+
59+
# Target backup #
60+
61+
When the backup cursor is opened with the \c target configuration string as \c "target=",
62+
WiredTiger internally generates a list of targeted files instead of all files like the full backup.
63+
If the targeted object is a table, all the indexes and column groups of the table are also backed up.
64+
65+
Note: There can only be one backup cursor open at a time unless using duplicate backup
66+
cursors. The duplicate backup cursors are used for catching up with the log files or with
67+
block-based incremental backup. Please refer to @ref backup_duplicate for more details.
68+
69+
*/

src/third_party/wiredtiger/src/docs/arch-index.dox

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ wt_file -[hidden]right-> log_file
123123

124124
We go into some detail for some of the internal components.
125125

126+
@subpage arch-backup
127+
128+
Hot backup uses a type of cursor to backup the database.
129+
126130
@subpage arch-block
127131

128132
The Block Manager manages the reading and writing of disk blocks.

src/third_party/wiredtiger/src/docs/backup.dox

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ the backup is available in the backup when that log file is included in the
7777
list of files. WiredTiger offers a mechanism to gather additional log files that
7878
may be created during the backup.
7979

80+
@section backup_duplicate Duplicate backup cursors
81+
8082
Since backups can take a long time, it may be desirable to catch up at the
8183
end of a backup with the log files so that operations that occurred during
8284
backup can be recovered. WiredTiger provides the ability to open a duplicate

0 commit comments

Comments
 (0)