0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00

SERVER-94779 Modify ignore_dbcheck_in_magic_restore.js to use refactored magic restore test utilities (#27057)

GitOrigin-RevId: 971024bece692e0b3650c10dfd195ec835325496
This commit is contained in:
Ali Mir 2024-09-13 13:10:28 -04:00 committed by MongoDB Bot
parent 622e34ea47
commit 03f0414ed6
2 changed files with 9 additions and 14 deletions

View File

@ -4,7 +4,8 @@
* @tags: [
* requires_persistence,
* requires_wiredtiger,
* featureFlagSecondaryIndexChecksInDbCheck
* featureFlagSecondaryIndexChecksInDbCheck,
* incompatible_with_windows_tls
* ]
*/
@ -19,12 +20,6 @@ import {
runDbCheck
} from "jstests/replsets/libs/dbcheck_utils.js";
// TODO SERVER-86034: Run on Windows machines once named pipe related failures are resolved.
if (_isWindows()) {
jsTestLog("Temporarily skipping test for Windows variants. See SERVER-86034.");
quit();
}
// TODO SERVER-87225: Enable fast count on validate when operations applied during a restore are
// counted correctly.
TestData.skipEnforceFastCountOnValidate = true;
@ -52,14 +47,14 @@ assert.commandWorked(sourceDb.runCommand({
indexes: [{key: {a: 1}, name: 'a_1'}],
}));
assert.eq(sourceColl.find({}).count(), nDocs);
const skipUnindexingDocumentWhenDeletedPrimary =
configureFailPoint(sourceDb, "skipUnindexingDocumentWhenDeleted", {indexName: "a_1"});
configureFailPoint(sourceDb, "skipUnindexingDocumentWhenDeleted", {indexName: "a_1"});
jsTestLog("Deleting docs");
assert.commandWorked(sourceColl.deleteMany({}));
assert.eq(sourceColl.find({}).count(), 0);
const magicRestoreTest = new magicRestoreTest(
{backupSource: sourcePrimary, pipeDir: MongoRunner.dataDir, insertHigherTermOplogEntry: true});
const magicRestoreTest = new MagicRestoreTest(
{rst: sourceCluster, pipeDir: MongoRunner.dataDir, insertHigherTermOplogEntry: true});
magicRestoreTest.takeCheckpointAndOpenBackup();
@ -86,7 +81,7 @@ let {lastOplogEntryTs, entriesAfterBackup} = magicRestoreTest.getEntriesAfterBac
magicRestoreTest.copyFilesAndCloseBackup();
let expectedConfig = assert.commandWorked(sourcePrimary.adminCommand({replSetGetConfig: 1})).config;
let expectedConfig = magicRestoreTest.getExpectedConfig();
// The new node will be allocated a new port by the test fixture.
expectedConfig.members[0].host = getHostName() + ":" + (Number(sourcePrimary.port) + 2);
let restoreConfiguration = {

View File

@ -10,7 +10,7 @@
* ]
*/
import {_copyFileHelper, openBackupCursor} from "jstests/libs/backup_utils.js";
import {copyFileHelper, openBackupCursor} from "jstests/libs/backup_utils.js";
import {ReplSetTest} from "jstests/libs/replsettest.js";
import {
checkHealthLog,
@ -95,7 +95,7 @@ jsTestLog("Backup cursor metadata document: " + tojson(backupCursor.next()));
while (backupCursor.hasNext()) {
let doc = backupCursor.next();
jsTestLog("Copying for backup: " + tojson(doc));
_copyFileHelper({filename: doc.filename, fileSize: doc.fileSize}, primary.dbpath, backupDbPath);
copyFileHelper({filename: doc.filename, fileSize: doc.fileSize}, primary.dbpath, backupDbPath);
}
backupCursor.close();