mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-24 00:17:37 +01:00
426cdd2f64
GitOrigin-RevId: a1bb1e232813f1c6e253be7c1703466d518a3ca7
18 lines
720 B
JavaScript
18 lines
720 B
JavaScript
import {
|
|
RoutingTableConsistencyChecker
|
|
} from "jstests/libs/check_routing_table_consistency_helpers.js";
|
|
import {DiscoverTopology, Topology} from "jstests/libs/discover_topology.js";
|
|
|
|
assert.neq(typeof db, 'undefined', 'No `db` object, is the shell connected to a server?');
|
|
|
|
const conn = db.getMongo();
|
|
const topology = DiscoverTopology.findConnectedNodes(conn);
|
|
|
|
assert(topology.type == Topology.kShardedCluster ||
|
|
(topology.type == Topology.kReplicaSet && topology.configsvr &&
|
|
TestData.testingReplicaSetEndpoint),
|
|
"Routing table consistency check must be run against a sharded cluster, but got: " +
|
|
tojson(topology));
|
|
|
|
RoutingTableConsistencyChecker.run(db.getMongo());
|