mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-24 00:17:37 +01:00
771dabd098
GitOrigin-RevId: 744aa110a53786b23c62ff53f87a1418b5991e8d
21 lines
652 B
JavaScript
21 lines
652 B
JavaScript
// Tests that a movePrimary will fail if the database doesn't have a version in config.databases.
|
|
|
|
import {ShardingTest} from "jstests/libs/shardingtest.js";
|
|
|
|
// Do not check metadata consistency as the database version is missing for testing purposes.
|
|
TestData.skipCheckMetadataConsistency = true;
|
|
TestData.skipCheckRoutingTableConsistency = true;
|
|
|
|
const dbName = "test";
|
|
|
|
const st = new ShardingTest({shards: 2});
|
|
|
|
assert.commandWorked(st.s.getDB("config").getCollection("databases").insert({
|
|
_id: dbName,
|
|
primary: st.shard0.shardName
|
|
}));
|
|
|
|
assert.commandFailed(st.s.adminCommand({movePrimary: dbName, to: st.shard1.shardName}));
|
|
|
|
st.stop();
|