@@ -33,37 +33,78 @@ source using the :parameter:`initialSyncSourceReadPreference` parameter.
33
33
This parameter can only be specified when starting the
34
34
:binary:`~bin.mongod`.
35
35
36
- Process
37
- ~~~~~~~
36
+ Starting in MongoDB 5.2, initial syncs can be *logical* or *file copy
37
+ based*.
38
38
39
- When you perform an initial sync, MongoDB:
39
+ .. _replica-set-initial-sync-logical:
40
+
41
+ Logical Initial Sync Process
42
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
+
44
+ When you perform a
45
+ :ref:`logical initial sync <replica-set-initial-sync-logical>`, MongoDB:
40
46
41
47
#. Clones all databases except the :ref:`local
42
48
<replica-set-local-database>` database. To clone, the
43
49
:binary:`~bin.mongod` scans every collection in each source database and
44
50
inserts all data into its own copies of these collections.
45
51
46
- .. versionchanged:: 3.4
47
- Initial sync builds all collection indexes as the documents are
48
- copied for each collection. In earlier versions of MongoDB, only
49
- the ``_id`` indexes are built during this stage.
50
-
51
- .. versionchanged:: 3.4
52
- Initial sync pulls newly added oplog records during the data copy. Ensure
53
- that the target member has enough disk space in the ``local``
54
- database to temporarily store these oplog records for the
55
- duration of this data copy stage.
52
+ #. Builds all collection indexes as the documents are copied for each
53
+ collection.
54
+
55
+ #. Pulls newly added oplog records during the data copy. Ensure that the
56
+ target member has enough disk space in the ``local`` database to
57
+ temporarily store these oplog records for the duration of this data
58
+ copy stage.
56
59
57
60
#. Applies all changes to the data set. Using the oplog from the
58
61
source, the :binary:`~bin.mongod` updates its data set to reflect the
59
62
current state of the replica set.
60
63
61
- When the initial sync finishes, the member transitions from
62
- :replstate:`STARTUP2` to :replstate:`SECONDARY`.
64
+ When the initial sync finishes, the member transitions from
65
+ :replstate:`STARTUP2` to :replstate:`SECONDARY`.
63
66
64
67
To perform an initial sync, see
65
68
:doc:`/tutorial/resync-replica-set-member`.
66
69
70
+ .. _replica-set-initial-sync-file-copy-based:
71
+
72
+ File Copy Based Initial Sync
73
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
+
75
+ :ref:`File copy based initial sync
76
+ <replica-set-initial-sync-filed-copy-based>` runs the initial sync
77
+ process by copying and moving files on the file system.
78
+
79
+ File copy based initial sync can be faster than
80
+ :ref:`logical initial sync <replica-set-initial-sync-logical>`.
81
+
82
+ It is only available on Enterprise Server.
83
+
84
+ Limitations
85
+ ```````````
86
+
87
+ - File copy based initial sync replaces the ``local`` database on the
88
+ node being *synced to* with the ``local`` database from the node
89
+ being *synced from*.
90
+
91
+ - You can only run an initial sync from one given node at a time.
92
+
93
+ - You cannot run a backup on the node that is being *synced to* during
94
+ the initial sync.
95
+
96
+ - You cannot run a backup on the node that is being *synced from* during
97
+ the initial sync.
98
+
99
+ - You cannot use file copy based initial sync with encrypted storage
100
+ engine to re-key the data.
101
+
102
+ .. warning::
103
+
104
+ You cannot write to the ``local`` database during a file copy based
105
+ sync.
106
+
107
+
67
108
.. _init-sync-retry:
68
109
69
110
Fault Tolerance
0 commit comments