[DOCS-8598] Add initial sync progress information to replSetGetStatus Created: 15/Aug/16  Updated: 13/Nov/23  Resolved: 06/Dec/18

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 3.4.0, 3.6, 4.0.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-25125 Add initial sync progress information... Closed
Related
related to DOCS-9753 3.4 Release notes inaccurately state:... Closed
related to DOCS-12844 Investigate changes in SERVER-7019: r... Closed
Participants:
Days since reply: 5 years, 9 weeks, 6 days ago

 Description   

With the new initial sync code, replSetGetStatus will now report information about the progress of initial sync. The replSetGetStatus command now accepts a second option: initialSync. For example:

db.runCommand({replSetGetStatus: 1, initialSync: 1})

The response will look like:

{
  "set": "initial_sync_replSetGetStatus",
  "date": ISODate("2016-08-15T20:27:25.081Z"),
  "myState": 5,
  "term": NumberLong(1),
  "syncingTo": "localhost:20010",
  "heartbeatIntervalMillis": NumberLong(2000),
  "optimes": {
    "lastCommittedOpTime": {
      "ts": Timestamp(1471292844,
      2),
      "t": NumberLong(1)
    },
    "appliedOpTime": {
      "ts": Timestamp(1471292844,
      2),
      "t": NumberLong(1)
    },
    "durableOpTime": {
      "ts": Timestamp(1471292844,
      2),
      "t": NumberLong(1)
    }
  },
  "initialSyncStatus": {
    "failedInitialSyncAttempts": 0,
    "maxFailedInitialSyncAttempts": 10,
    "initialSyncStart": ISODate("2016-08-15T20:27:23.028Z"),
    "initialSyncEnd": ISODate("2016-08-15T20:27:24.302Z"),
    "initialSyncElapsedMillis": 1274,
    "initialSyncAttempts": [
      {
        "durationMillis": 1147,
        "status": "OK",
        "syncSource": "localhost:20010"
      }
    ],
    "fetchedMissingDocs": 0,
    "appliedOps": 2,
    "databases": {
      "databasesCloned": 1,
      "test": {
        "collections": 1,
        "clonedCollections": 1,
        "start": ISODate("2016-08-15T20:27:24.171Z"),
        "end": ISODate("2016-08-15T20:27:24.291Z"),
        "elapsedMillis": 120,
        "test.foo": {
          "documents": 4,
          "indexes": 1,
          "fetchedBatches": 1,
          "start": ISODate("2016-08-15T20:27:24.173Z"),
          "end": ISODate("2016-08-15T20:27:24.291Z"),
          "elapsedMillis": 118
        }
      }
    }
  },
  "members": [
    {
      "_id": 0,
      "name": "localhost:20010",
      "health": 1,
      "state": 1,
      "stateStr": "PRIMARY",
      "uptime": 2,
      "optime": {
        "ts": Timestamp(1471292842,
        5),
        "t": NumberLong(1)
      },
      "optimeDurable": {
        "ts": Timestamp(1471292842,
        5),
        "t": NumberLong(1)
      },
      "optimeDate": ISODate("2016-08-15T20:27:22Z"),
      "optimeDurableDate": ISODate("2016-08-15T20:27:22Z"),
      "lastHeartbeat": ISODate("2016-08-15T20:27:23.028Z"),
      "lastHeartbeatRecv": ISODate("2016-08-15T20:27:24.991Z"),
      "pingMs": NumberLong(1),
      "electionTime": Timestamp(1471292841,
      2),
      "electionDate": ISODate("2016-08-15T20:27:21Z"),
      "configVersion": 2
    },
    {
      "_id": 1,
      "name": "localhost:20011",
      "health": 1,
      "state": 5,
      "stateStr": "STARTUP2",
      "uptime": 3,
      "optime": {
        "ts": Timestamp(1471292844,
        2),
        "t": NumberLong(1)
      },
      "optimeDate": ISODate("2016-08-15T20:27:24Z"),
      "syncingTo": "localhost:20010",
      "infoMessage": "syncing from: localhost:20010",
      "configVersion": 2,
      "self": true
    }
  ],
  "ok": 1
}

The fields change depending on the progress made so far and after initial sync finishes the progress data is logged, but will no longer appear in replSetGetStatus.

failedInitialSyncAttempts = the number of times initial sync failed and had to restart
maxFailedInitialSyncAttempts = the max number of times initial sync will restart before mongod shuts down
initialSyncStart = start time
InitialSyncEnd = end time
initialSyncElapsedMillis = milliseconds between start and end above
initialSyncAttempts = array of objects where durationMillis = duration for the attempt, status = exit status of the attempt, including the error message if it failed. syncSource = the node that this node is initial syncing from.
fetchedMissingDocs = the number of documents that we needed to fetch from the sync source when applying ops that occurred after initial sync began.
appliedOps = number of ops that occurred after initialsync began that needed to be applied at the end of initial sync
databases = an object containing information about the database cloning.
databases.databasesCloned = number of databases done being cloned
databases.<database name> = information about the cloning of that database.
databases.<database name>.collections = number of collections in the database
databases.<database name>.clonedCollections = number of collections done being cloned from the database
databases.<database name>.start = start time for the database clone
databases.<database name>.end = end time for the database clone
databases.<database name>.elapsedMillis = time between start and end for the database clone
databases.<database name>.<collection namespace> = information about the collection cloning process.
databases.<database name>.<collection namespace>.documents = documents cloned so far
databases.<database name>.<collection namespace>.indexes = indexes cloned so far
databases.<database name>.<collection namespace>.fetchedBatches = number of batches of documents fetched so far
databases.<database name>.<collection namespace>.start = start time for the collection clone
databases.<database name>.<collection namespace>.end = end time for the collection clone
databases.<database name>.<collection namespace>.elapsedMillis = time between start and end of collection clone.



 Comments   
Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: tweak example output
Branch: master
https://github.com/mongodb/docs/commit/67e883d1c2bdfea6c9f75fc9c8cd4db221e19c60

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: tweak example output
Branch: v4.0
https://github.com/mongodb/docs/commit/caf5bb7d1e3aaa729a808144feaf1ed3c3c3be52

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: v3.4
https://github.com/mongodb/docs/commit/59f81eb460ebc11bc80cacf1ab1718f51dd27c01

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: v3.6
https://github.com/mongodb/docs/commit/c6ad646433133a8ee52684ce8b01b34d9d733d66

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: v4.0
https://github.com/mongodb/docs/commit/95e625e3c09892d36a2e3454ff8d8c5ee2304779

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: master
https://github.com/mongodb/docs/commit/692e5be26fe56706af8d9db60700a60e58aa2202

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: Revert "DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus"

This reverts commit c97a4c3f77ce47690315e9ff6ce2b856272f1279.
Branch: v4.0
https://github.com/mongodb/docs/commit/ba9a17d744a9baa7fdffa989969e124da49b9328

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: Revert "DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus"

This reverts commit e75cffdbcabed5459cbc6f92c237d75d928d2814.
Branch: master
https://github.com/mongodb/docs/commit/cd7ce58f9f41265fb81edd2f78c98fa4e0e4c9d3

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: v4.0
https://github.com/mongodb/docs/commit/c97a4c3f77ce47690315e9ff6ce2b856272f1279

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-8598: 3.4 - replSetGetStatus: initialSyncStatus
Branch: master
https://github.com/mongodb/docs/commit/e75cffdbcabed5459cbc6f92c237d75d928d2814

Generated at Thu Feb 08 07:56:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.