0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-21 12:39:08 +01:00

SERVER-93221 Drop config.placementHistory metadata in magic restore (#27202)

GitOrigin-RevId: 420cef3a7d863ad12e45237fa53fb1756dde3879
This commit is contained in:
Frederic Vitzikam (fredvitz) 2024-10-24 17:26:14 +02:00 committed by MongoDB Bot
parent fd41f93f13
commit 65f2d62f40

View File

@ -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") {