Skip to content

Commit 8e535a4

Browse files
authored
New replSetGetStatus.initialSyncStatus fields when using FCBIS (#379)
* documents new replSetGetStatus.initialSyncStatus fields * updates * review feedback * tech review feedback * tech review feedback * small spacing fix
1 parent e4b930f commit 8e535a4

File tree

3 files changed

+163
-15
lines changed

3 files changed

+163
-15
lines changed

source/includes/fact-rs-status-init-sync-availability.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
available when run on a member during its initial sync (i.e.
77
:replstate:`STARTUP2` state).
88

9-
In earlier versions (3.4.x-4.2.0),
9+
In earlier versions (3.6.x-4.2.0),
1010
:data:`replSetGetStatus.initialSyncStatus` metrics are available
1111
when the command is run with ``initialSync: 1`` option on a
1212
secondary or a member in its :replstate:`STARTUP2` state, even after

source/reference/command/replSetGetStatus.txt

Lines changed: 158 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The command has the following syntax:
4747
another state, the :data:`replSetGetStatus.initialSyncStatus`
4848
metrics are no longer available.
4949

50-
- In earlier versions (3.4.x-4.2.0)
50+
- In earlier versions (3.6.x-4.2.0)
5151
To return :ref:`initial sync <replica-set-initial-sync>` status
5252
information, include ``initialSync: 1`` in the command on a
5353
secondary member or a member in :replstate:`STARTUP2` state:
@@ -84,7 +84,7 @@ Example
8484

8585
.. code-block:: javascript
8686

87-
db.adminCommand( { replSetGetStatus : 1 } )
87+
db.adminCommand( { replSetGetStatus: 1 } )
8888

8989
The command returns the following output for an example
9090
replica set primary:
@@ -265,7 +265,7 @@ Example
265265

266266
.. code-block:: javascript
267267

268-
db.adminCommand( { replSetGetStatus : 1 } )
268+
db.adminCommand( { replSetGetStatus: 1 } )
269269

270270
The command returns the following output for an example replica set secondary:
271271

@@ -417,44 +417,53 @@ Example
417417
"operationTime" : Timestamp(1583386018, 1)
418418
}
419419

420-
In earlier versions (3.4.x-4.2.0)
420+
In earlier versions (3.6.x-4.2.0)
421421
You can include the optional ``initialSync: 1`` to include
422422
the :data:`replSetGetStatus.initialSyncStatus` in the
423423
output (you can omit if you do not want to return the
424424
initial sync status):
425425

426426
.. code-block:: javascript
427427

428-
db.adminCommand( { replSetGetStatus : 1, initialSync: 1} )
428+
db.adminCommand( { replSetGetStatus: 1, initialSync: 1 } )
429429

430430
- id: startup2
431431
name: Include Initial Sync Metrics
432432
content: |
433433

434+
Starting in MongoDB 5.2,
435+
the :data:`replSetGetStatus.initialSyncStatus` document
436+
contains :ref:`additional fields
437+
<fcbis-initial-sync-fields>` when using a
438+
:ref:`file copy based initial sync
439+
<replica-set-initial-sync-file-copy-based>`.
440+
441+
434442
Starting in MongoDB 4.2.1,
435443
If you run :dbcommand:`replSetGetStatus` on a member
436444
during its initial sync, the command returns
437445
:data:`replSetGetStatus.initialSyncStatus` metrics.
438446

439447
.. code-block:: javascript
440448

441-
db.adminCommand( { replSetGetStatus : 1} )
449+
db.adminCommand( { replSetGetStatus: 1 } )
442450

443-
Once the member finishes its initial sync and transitions to
444-
another state,the :data:`replSetGetStatus.initialSyncStatus`
445-
metrics is no longer available.
451+
Once the member finishes its initial sync and transitions
452+
to another state, the
453+
:data:`replSetGetStatus.initialSyncStatus` document is no
454+
longer available.
446455

447-
In earlier versions (3.4.x-4.2.0)
456+
In earlier versions (3.6.x-4.2.0)
448457
You can include the optional ``initialSync: 1`` to include
449458
the :data:`replSetGetStatus.initialSyncStatus` in the
450459
output (you can omit if you do not want to return the
451460
initial sync status):
452461

453462
.. code-block:: javascript
454463

455-
db.adminCommand( { replSetGetStatus : 1, initialSync: 1} )
464+
db.adminCommand( { replSetGetStatus: 1, initialSync: 1 } )
456465

457-
For 3.4.x-4.2.0 replica sets,
466+
For 3.6.x-4.2.0 replica sets,
458467
:data:`replSetGetStatus.initialSyncStatus` metrics remains
459468
available after the member completes its initial sync.
460469
That is, you can run the :dbcommand:`replSetGetStatus`
@@ -1050,7 +1059,7 @@ following fields:
10501059
.. data:: replSetGetStatus.initialSyncStatus
10511060

10521061

1053-
A document provides information on the progress and status of
1062+
A document that provides information on the progress and status of
10541063
:ref:`initial sync <replica-set-initial-sync>` on this member.
10551064

10561065
.. include:: /includes/fact-rs-status-init-sync-availability.rst
@@ -1132,7 +1141,11 @@ following fields:
11321141
* - rollBackId
11331142

11341143
- The sync source's rollback identifier at the start of the
1135-
initial sync attempt.
1144+
initial sync attempt.
1145+
1146+
``rollBackId`` does not appear when using
1147+
:ref:`file copy based initial sync
1148+
<replica-set-initial-sync-file-copy-based>`.
11361149

11371150
.. versionadded:: 4.4
11381151

@@ -1251,6 +1264,137 @@ following fields:
12511264
}
12521265
}
12531266

1267+
.. _fcbis-initial-sync-fields:
1268+
1269+
.. data:: replSetGetStatus.initialSyncStatus.method
1270+
1271+
.. versionadded:: 5.2
1272+
1273+
The method used for the :ref:`initial sync
1274+
<replica-set-initial-sync>`.
1275+
1276+
If set to ``logical``, the sync is a :ref:`logical initial sync
1277+
<replica-set-initial-sync-logical>`. If set to ``fileCopyBased``, the
1278+
sync is a :ref:`file copy based initial sync
1279+
<replica-set-initial-sync-file-copy-based>`.
1280+
1281+
.. data:: replSetGetStatus.initialSyncStatus.approxTotalDataSize
1282+
1283+
The approximate size (in bytes) of all files to be synced during
1284+
:ref:`file copy based initial sync
1285+
<replica-set-initial-sync-file-copy-based>`.
1286+
1287+
This field only appears when using :ref:`file copy based initial
1288+
sync <replica-set-initial-sync-file-copy-based>`.
1289+
1290+
.. data:: replSetGetStatus.initialSyncStatus.approxTotalBytesCopied
1291+
1292+
The total bytes already copied.
1293+
1294+
This field only appears when using :ref:`file copy based initial
1295+
sync <replica-set-initial-sync-file-copy-based>`.
1296+
1297+
.. data:: replSetGetStatus.initialSyncStatus.totalInitialSyncElapsedMillis
1298+
1299+
The total time elapsed for the sync attempt in progress.
1300+
1301+
This field only appears when using :ref:`file copy based initial
1302+
sync <replica-set-initial-sync-file-copy-based>`.
1303+
1304+
.. data:: replSetGetStatus.initialSyncStatus.remainingInitialSyncEstimatedMillis
1305+
1306+
The expected time remaining for the sync attempt in progress.
1307+
1308+
This field only appears when using :ref:`file copy based initial
1309+
sync <replica-set-initial-sync-file-copy-based>`.
1310+
1311+
.. data:: replSetGetStatus.initialSyncStatus.initialBackupDataSize
1312+
1313+
The total size (in bytes) of the initial set of files to be synced.
1314+
1315+
This field only appears when using :ref:`file copy based initial
1316+
sync <replica-set-initial-sync-file-copy-based>`.
1317+
1318+
.. data:: replSetGetStatus.initialSyncStatus.previousOplogEnd
1319+
1320+
The :term:`optime` available in the previous :term:`backup cursor`.
1321+
1322+
This field only appears when using :ref:`file copy based initial
1323+
sync <replica-set-initial-sync-file-copy-based>`.
1324+
1325+
.. data:: replSetGetStatus.initialSyncStatus.currentOplogEnd
1326+
1327+
The last :term:`optime` guaranteed to be available in the current
1328+
:term:`backup cursor`.
1329+
1330+
This field only appears when using :ref:`file copy based initial
1331+
sync <replica-set-initial-sync-file-copy-based>`.
1332+
1333+
.. data:: replSetGetStatus.initialSyncStatus.syncSourceLastApplied
1334+
1335+
The :term:`optime` of the last update applied at the sync source
1336+
prior to the start of this :term:`backup cursor`.
1337+
1338+
This field only appears when using :ref:`file copy based initial
1339+
sync <replica-set-initial-sync-file-copy-based>`.
1340+
1341+
.. _fcbis-extension:
1342+
1343+
.. data:: replSetGetStatus.initialSyncStatus.numExtensions
1344+
1345+
The number of times the sync has started a new :term:`backup cursor`.
1346+
1347+
This field does not appear if a backup cursor has not started.
1348+
1349+
This field only appears when using :ref:`file copy based initial
1350+
sync <replica-set-initial-sync-file-copy-based>`.
1351+
1352+
.. data:: replSetGetStatus.initialSyncStatus.extensionDataSize
1353+
1354+
The total bytes in the current :ref:`extension <fcbis-extension>`.
1355+
1356+
This field does not appear if there is no extension in progress.
1357+
1358+
This field only appears when using :ref:`file copy based initial
1359+
sync <replica-set-initial-sync-file-copy-based>`.
1360+
1361+
.. data:: replSetGetStatus.initialSyncStatus.files
1362+
1363+
An array of files to be synced during :ref:`file copy based initial
1364+
sync <replica-set-initial-sync-file-copy-based>`.
1365+
1366+
This field only appears when using :ref:`file copy based initial
1367+
sync <replica-set-initial-sync-file-copy-based>`.
1368+
1369+
.. data:: replSetGetStatus.initialSyncStatus.files[n].filePath
1370+
1371+
The path of the file relative to the root of the
1372+
:term:`backup cursor`.
1373+
1374+
This field only appears when using :ref:`file copy based initial
1375+
sync <replica-set-initial-sync-file-copy-based>`.
1376+
1377+
.. data:: replSetGetStatus.initialSyncStatus.files[n].fileSize
1378+
1379+
The size of the file as reported by the :term:`backup cursor`.
1380+
1381+
This field only appears when using :ref:`file copy based initial
1382+
sync <replica-set-initial-sync-file-copy-based>`.
1383+
1384+
.. data:: replSetGetStatus.initialSyncStatus.files[n].bytesCopied
1385+
1386+
The number of bytes copied so far.
1387+
1388+
This field only appears when using :ref:`file copy based initial
1389+
sync <replica-set-initial-sync-file-copy-based>`.
1390+
1391+
.. data:: replSetGetStatus.initialSyncStatus.files[n].extensionNumber
1392+
1393+
The number of the :ref:`extension <fcbis-extension>` the file belongs
1394+
to if this file is part of an extension.
1395+
1396+
This field only appears when using :ref:`file copy based initial
1397+
sync <replica-set-initial-sync-file-copy-based>`.
12541398

12551399
.. data:: replSetGetStatus.members
12561400

source/reference/glossary.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ Glossary
9090
maintenance operations on a sharded cluster. See
9191
:ref:`sharding-balancing`.
9292

93+
backup cursor
94+
A :term:`tailable cursor` that points to a list of backup files.
95+
Backup cursors are for internal use only.
96+
9397
BSON
9498
A serialization format used to store :term:`documents <document>` and make
9599
remote procedure calls in MongoDB. "BSON" is a portmanteau of the words

0 commit comments

Comments
 (0)