summaryrefslogtreecommitdiff
path: root/jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js')
-rw-r--r--jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js72
1 files changed, 36 insertions, 36 deletions
diff --git a/jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js b/jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js
index 0dca4e5efd6..3b83bda0888 100644
--- a/jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js
+++ b/jstests/replsets/startup_without_fcv_document_succeeds_if_initial_sync_flag_set.js
@@ -4,40 +4,40 @@
*/
(function() {
- load("jstests/libs/check_log.js");
- load("jstests/libs/feature_compatibility_version.js");
-
- rst = new ReplSetTest({nodes: 1});
- rst.startSet();
- rst.initiate();
-
- jsTestLog("Adding a second node to the replica set.");
-
- const adminDbName = "admin";
- const versionCollName = "system.version";
- const nss = adminDbName + "." + versionCollName;
-
- // Hang initial sync before cloning the FCV document.
- let secondary = rst.add({rsConfig: {priority: 0}});
- assert.commandWorked(secondary.getDB('admin').runCommand({
- configureFailPoint: 'initialSyncHangBeforeCollectionClone',
- mode: 'alwaysOn',
- data: {namespace: nss}
- }));
- rst.reInitiate();
- checkLog.contains(secondary, "initialSyncHangBeforeCollectionClone fail point enabled.");
-
- jsTestLog("Restarting secondary in the early stages of initial sync.");
- rst.restart(secondary);
-
- rst.awaitSecondaryNodes();
-
- // Get the new secondary connection.
- secondary = rst.getSecondary();
- secondary.setSlaveOk(true);
-
- const secondaryAdminDb = secondary.getDB("admin");
- // Assert that the FCV document was cloned through initial sync on the secondary.
- checkFCV(secondaryAdminDb, latestFCV);
- rst.stopSet();
+load("jstests/libs/check_log.js");
+load("jstests/libs/feature_compatibility_version.js");
+
+rst = new ReplSetTest({nodes: 1});
+rst.startSet();
+rst.initiate();
+
+jsTestLog("Adding a second node to the replica set.");
+
+const adminDbName = "admin";
+const versionCollName = "system.version";
+const nss = adminDbName + "." + versionCollName;
+
+// Hang initial sync before cloning the FCV document.
+let secondary = rst.add({rsConfig: {priority: 0}});
+assert.commandWorked(secondary.getDB('admin').runCommand({
+ configureFailPoint: 'initialSyncHangBeforeCollectionClone',
+ mode: 'alwaysOn',
+ data: {namespace: nss}
+}));
+rst.reInitiate();
+checkLog.contains(secondary, "initialSyncHangBeforeCollectionClone fail point enabled.");
+
+jsTestLog("Restarting secondary in the early stages of initial sync.");
+rst.restart(secondary);
+
+rst.awaitSecondaryNodes();
+
+// Get the new secondary connection.
+secondary = rst.getSecondary();
+secondary.setSlaveOk(true);
+
+const secondaryAdminDb = secondary.getDB("admin");
+// Assert that the FCV document was cloned through initial sync on the secondary.
+checkFCV(secondaryAdminDb, latestFCV);
+rst.stopSet();
}());