diff options
Diffstat (limited to 'jstests/replsets/ignore_dbcheck_in_initial_sync.js')
| -rw-r--r-- | jstests/replsets/ignore_dbcheck_in_initial_sync.js | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/jstests/replsets/ignore_dbcheck_in_initial_sync.js b/jstests/replsets/ignore_dbcheck_in_initial_sync.js deleted file mode 100644 index 8efc8dcabf4..00000000000 --- a/jstests/replsets/ignore_dbcheck_in_initial_sync.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Test that dbcheck will be ignored during initial sync. - * - * @tags: [ - * featureFlagSecondaryIndexChecksInDbCheck - * ] - */ - -load("jstests/replsets/libs/dbcheck_utils.js"); -load("jstests/libs/fail_point_util.js"); - -// Skipping data consistency checks because data is inserted into primary and secondary separately. -TestData.skipCollectionAndIndexValidation = true; -TestData.skipCheckDBHashes = true; - -const dbName = "ignore_dbcheck_in_intial_sync"; -const collName = "ignore_dbcheck_in_intial_sync-collection"; - -const doc1 = { - a: 1 -}; - -const replSet = new ReplSetTest({ - name: jsTestName(), - nodes: [ - {}, - { - rsConfig: - // disallow elections on secondary - {priority: 0} - } - ], - nodeOptions: {setParameter: {dbCheckHealthLogEveryNBatches: 1}} -}); -replSet.startSet(); -replSet.initiateWithHighElectionTimeout(); - -const primary = replSet.getPrimary(); -const secondary = replSet.getSecondary(); -const primaryHealthlog = primary.getDB("local").system.healthlog; -const primaryDb = primary.getDB(dbName); -const maxDocsPerBatch = 100; - -jsTestLog("Testing that dbcheck command will be ignored during initial sync."); - -const nDocs = 10; -insertDocsWithMissingIndexKeys(replSet, dbName, collName, doc1, nDocs); - -replSet.awaitReplication(); - -const initialSyncNode = replSet.add({rsConfig: {priority: 0}}); - -const initialSyncHangBeforeSplittingControlFlowFailPoint = - configureFailPoint(initialSyncNode, "initialSyncHangBeforeSplittingControlFlow"); - -replSet.reInitiate(); - -initialSyncHangBeforeSplittingControlFlowFailPoint.wait(); - -// TODO SERVER-89921: Uncomment validateMode once the relevant tickets are backported. -runDbCheck(replSet, - primaryDb, - collName, - { - maxDocsPerBatch: - maxDocsPerBatch //, validateMode: "dataConsistencyAndMissingIndexKeysCheck" - }); - -// Wait until the primary finished dbcheck before turning off the initial sync failpoint so that the -// initial sync node would need to apply (ignore) dbCheckStop in initial sync. -checkHealthLog(primaryHealthlog, {"operation": "dbCheckStop"}, 1); - -assert.commandWorked(initialSyncNode.adminCommand( - {configureFailPoint: 'initialSyncHangBeforeSplittingControlFlow', mode: 'off'})); - -replSet.waitForState(initialSyncNode, ReplSetTest.State.SECONDARY); - -// TODO SERVER-89921: Uncomment all of the following checkHealthLog once the relevant tickets are -// backported. -// Check that the primary logged an error health log entry for each document with missing index key. -// checkHealthLog(primaryHealthlog, logQueries.missingIndexKeysQuery, nDocs); -// Check that the primary does not have other error/warning entries. -// checkHealthLog(primaryHealthlog, logQueries.allErrorsOrWarningsQuery, nDocs); -// Check that the start, batch, and stop entries are warning logs since the node skips dbcheck -// during initial sync. -const initialSyncNodeHealthLog = initialSyncNode.getDB("local").system.healthlog; -checkHealthLog(initialSyncNodeHealthLog, logQueries.duringInitialSyncQuery, 3); -// Check that the initial sync node does not have other info or error/warning entries. -checkHealthLog(initialSyncNodeHealthLog, logQueries.infoBatchQuery, 0); -checkHealthLog(initialSyncNodeHealthLog, logQueries.allErrorsOrWarningsQuery, 3); - -replSet.stopSet(); |
