summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorMedha Potluri <medha.potluri@mongodb.com>2019-05-30 11:22:10 -0400
committerMedha Potluri <medha.potluri@mongodb.com>2019-06-13 17:04:31 -0400
commitfffb564422ebf4d0569052ebe61bd96e6494e25f (patch)
tree90aa55c4fa12958e83ed9a32a159ad0964c443cd /jstests/disk
parentf90df932ab3f8c5f279b6f14343fe0efa80c1b9a (diff)
downloadmongo-fffb564422ebf4d0569052ebe61bd96e6494e25f.tar.gz
SERVER-7019 Return initial sync status information by default in replSetGetStatus and remove it after successful initial sync attempt
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/libs/wt_file_helper.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/jstests/disk/libs/wt_file_helper.js b/jstests/disk/libs/wt_file_helper.js
index 54e7781608d..75bd3688301 100644
--- a/jstests/disk/libs/wt_file_helper.js
+++ b/jstests/disk/libs/wt_file_helper.js
@@ -128,10 +128,15 @@ let assertStartInReplSet = function(replSet, originalNode, cleanData, expectResy
let node = replSet.start(
originalNode, {dbpath: originalNode.dbpath, port: originalNode.port, restart: !cleanData});
+ // Skip clearing initial sync progress after a successful initial sync attempt so that we
+ // can check initialSyncStatus fields after initial sync is complete.
+ assert.commandWorked(
+ node.adminCommand({configureFailPoint: 'skipClearInitialSyncState', mode: 'alwaysOn'}));
+
replSet.awaitSecondaryNodes();
// Ensure that an initial sync attempt was made and succeeded if the data directory was cleaned.
- let res = assert.commandWorked(node.adminCommand({replSetGetStatus: 1, initialSync: 1}));
+ let res = assert.commandWorked(node.adminCommand({replSetGetStatus: 1}));
if (expectResync) {
assert.eq(1, res.initialSyncStatus.initialSyncAttempts.length);
assert.eq(0, res.initialSyncStatus.failedInitialSyncAttempts);
@@ -139,6 +144,9 @@ let assertStartInReplSet = function(replSet, originalNode, cleanData, expectResy
assert.eq(undefined, res.initialSyncStatus);
}
+ assert.commandWorked(
+ node.adminCommand({configureFailPoint: 'skipClearInitialSyncState', mode: 'off'}));
+
testFunc(node);
return node;
};