diff --git a/jstests/hooks/magic_restore.js b/jstests/hooks/magic_restore.js index d3d192f6298..d912379504e 100644 --- a/jstests/hooks/magic_restore.js +++ b/jstests/hooks/magic_restore.js @@ -192,7 +192,12 @@ function dataConsistencyCheck(sourceNode, restoreNode, consistencyTs) { let sourceDb = sourceNode.getDB(dbName); let restoreDb = restoreNode.getDB(dbName); - let sourceCollections = sourceDatabases[dbName].sort((a, b) => a.localeCompare(b)); + // Restore will drop "config.placementHistory", so we should omit that namespace from the + // consistency checker. + let sourceCollections = + sourceDatabases[dbName] + .filter(collection => dbName !== "config" || collection !== "placementHistory") + .sort((a, b) => a.localeCompare(b)); let restoreCollections = restoreDatabases[dbName].sort((a, b) => a.localeCompare(b)); let idx = 0; @@ -210,7 +215,8 @@ function dataConsistencyCheck(sourceNode, restoreNode, consistencyTs) { // collection is expected to be different here since shard names and last known ping // times will be different from the source node. The preimages and change_collections // collections use independent untimestamped truncates to delete old data, and therefore - // they be inconsistent between source and destination. + // they be inconsistent between source and destination. placementHistory is dropped by + // magic restore. if (sourceCollName === "system.keys" || sourceCollName === "mongos" || sourceCollName === "system.preimages" || sourceCollName === "system.change_collection") {