SERVER-90150 Redundant checks when config server is also a shard (#48069)

GitOrigin-RevId: 6a97d7e445817362e02b450bea0b42153c223fb2
This commit is contained in:
marcobizzarri-mdb 2026-02-18 14:47:03 +00:00 committed by MongoDB Bot
parent cf8df49b83
commit ef2d014f90
2 changed files with 13 additions and 4 deletions

View File

@ -61,9 +61,11 @@ import {ReplSetTest} from "jstests/libs/replsettest.js";
throw new Error("Unrecognized topology format: " + tojson(topology));
}
const csrsNodes = new Set();
const threads = [];
try {
if (topology.configsvr.nodes.length > 1) {
topology.configsvr.nodes.forEach((n) => csrsNodes.add(n));
const thread = new Thread(checkReplicatedDataHashesThread, topology.configsvr.nodes);
threads.push(thread);
thread.start();
@ -84,9 +86,14 @@ import {ReplSetTest} from "jstests/libs/replsettest.js";
}
if (shard.nodes.length > 1) {
const thread = new Thread(checkReplicatedDataHashesThread, shard.nodes);
threads.push(thread);
thread.start();
// we just check the first node
if (csrsNodes.has(shard.nodes[0])) {
print("Skipping data consistency for shard since it was already checked in the CSRS");
} else {
const thread = new Thread(checkReplicatedDataHashesThread, shard.nodes);
threads.push(thread);
thread.start();
}
} else {
print("Skipping data consistency checks for 1-node replica set shard: " + tojsononeline(topology));
}

View File

@ -78,7 +78,9 @@ if (requiredFCV) {
assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: requiredFCV, confirm: true}));
}
new CollectionValidator().validateNodes(hostList);
const deduplicatedHostList = [...new Set(hostList)];
new CollectionValidator().validateNodes(deduplicatedHostList);
if (originalFCV && originalFCV.version !== requiredFCV) {
assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: originalFCV.version, confirm: true}));