summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2023-04-17 22:11:41 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-24 01:33:22 +0000
commite3e4b4d6a54a671e564d8bd9e4b34188ab4accd0 (patch)
tree333062c1c55466d24c256efbc666e37008046a26 /jstests/noPassthrough
parentbd7b3ee926b2cd488c0c71c4208d5737345f7ed8 (diff)
downloadmongo-e3e4b4d6a54a671e564d8bd9e4b34188ab4accd0.tar.gz
SERVER-76310 Use config shard terminology instead of catalog shard
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/catalog_shard.js35
-rw-r--r--jstests/noPassthrough/catalog_shard_resharding_fixture.js4
-rw-r--r--jstests/noPassthrough/catalog_shard_secondary_reads.js12
-rw-r--r--jstests/noPassthrough/change_streams_per_shard_cursor.js8
-rw-r--r--jstests/noPassthrough/cluster_commands_require_cluster_node.js8
-rw-r--r--jstests/noPassthrough/dedicated_to_catalog_shard.js10
-rw-r--r--jstests/noPassthrough/transition_to_catalog_shard_feature_flag.js11
7 files changed, 45 insertions, 43 deletions
diff --git a/jstests/noPassthrough/catalog_shard.js b/jstests/noPassthrough/catalog_shard.js
index 5ecf55ad8d0..a78dc8455e5 100644
--- a/jstests/noPassthrough/catalog_shard.js
+++ b/jstests/noPassthrough/catalog_shard.js
@@ -1,5 +1,5 @@
/**
- * Tests catalog shard topology.
+ * Tests config shard topology.
*
* @tags: [
* requires_persistence,
@@ -11,7 +11,7 @@
(function() {
"use strict";
-load("jstests/libs/catalog_shard_util.js");
+load("jstests/libs/config_shard_util.js");
load("jstests/libs/fail_point_util.js");
load("jstests/libs/write_concern_util.js");
@@ -45,7 +45,7 @@ function getCatalogShardChunks(conn) {
const st = new ShardingTest({
shards: 1,
config: 3,
- catalogShard: true,
+ configShard: true,
});
const configShardName = st.shard0.shardName;
@@ -175,7 +175,7 @@ const newShardName =
{
//
- // Can't remove catalogShard using the removeShard command.
+ // Can't remove configShard using the removeShard command.
//
assert.commandFailedWithCode(st.s.adminCommand({removeShard: "config"}),
@@ -184,7 +184,7 @@ const newShardName =
{
//
- // Remove the catalog shard.
+ // Remove the config shard.
//
let configPrimary = st.configRS.getPrimary();
@@ -200,7 +200,7 @@ const newShardName =
st.s0.adminCommand({transitionToDedicatedConfigServer: 1, writeConcern: {wtimeout: 100}}));
assert.eq("started", removeRes.state);
- // The removal won't complete until all chunks and dbs are moved off the catalog shard.
+ // The removal won't complete until all chunks and dbs are moved off the config shard.
removeRes = assert.commandWorked(st.s0.adminCommand({transitionToDedicatedConfigServer: 1}));
assert.eq("ongoing", removeRes.state);
@@ -242,7 +242,7 @@ const newShardName =
assert.eq(1, removeRes.pendingRangeDeletions);
suspendRangeDeletionFp.off();
- CatalogShardUtil.waitForRangeDeletions(st.s);
+ ConfigShardUtil.waitForRangeDeletions(st.s);
// Start the final transition command. This will trigger locally dropping collections on the
// config server. Hang after removing one collection and trigger a failover to verify the final
@@ -293,7 +293,7 @@ const newShardName =
{
//
- // Can't create catalogShard using the addShard command.
+ // Can't create configShard using the addShard command.
//
assert.commandFailed(st.s.adminCommand({addShard: st.configRS.getURL(), name: "config"}));
@@ -310,7 +310,7 @@ const newShardName =
{
//
- // Add back the catalog shard.
+ // Add back the config shard.
//
// Create an index while the collection is not on the config server to verify it clones the
@@ -320,7 +320,7 @@ const newShardName =
// Use write concern to verify the command support them. Any values weaker than the default
// sharding metadata write concerns will be upgraded.
assert.commandWorked(
- st.s.adminCommand({transitionToCatalogShard: 1, writeConcern: {wtimeout: 100}}));
+ st.s.adminCommand({transitionFromDedicatedConfigServer: 1, writeConcern: {wtimeout: 100}}));
// Basic CRUD and sharded DDL work.
basicCRUD(st.s);
@@ -338,12 +338,12 @@ const newShardName =
{
//
- // transitionToCatalogShard requires replication to all config server nodes.
+ // transitionFromDedicatedConfigServer requires replication to all config server nodes.
//
// TODO SERVER-75391: Remove.
//
- // Transition to dedicated mode so the config server can transition back to catalog shard mode.
+ // Transition to dedicated mode so the config server can transition back to config shard mode.
let removeRes = assert.commandWorked(st.s.adminCommand({transitionToDedicatedConfigServer: 1}));
assert.eq("started", removeRes.state);
assert.commandWorked(st.s.adminCommand(
@@ -355,17 +355,18 @@ const newShardName =
assert.commandWorked(st.s.adminCommand({movePrimary: "directDB", to: newShardName}));
assert.commandWorked(st.s.adminCommand({transitionToDedicatedConfigServer: 1}));
- // transitionToCatalogShard times out with a lagged config secondary despite having a majority
- // of its set still replicating.
+ // transitionFromDedicatedConfigServer times out with a lagged config secondary despite having a
+ // majority of its set still replicating.
const laggedSecondary = st.configRS.getSecondary();
st.configRS.awaitReplication();
stopServerReplication(laggedSecondary);
- assert.commandFailedWithCode(st.s.adminCommand({transitionToCatalogShard: 1, maxTimeMS: 1000}),
- ErrorCodes.MaxTimeMSExpired);
+ assert.commandFailedWithCode(
+ st.s.adminCommand({transitionFromDedicatedConfigServer: 1, maxTimeMS: 1000}),
+ ErrorCodes.MaxTimeMSExpired);
restartServerReplication(laggedSecondary);
// Now it succeeds.
- assert.commandWorked(st.s.adminCommand({transitionToCatalogShard: 1}));
+ assert.commandWorked(st.s.adminCommand({transitionFromDedicatedConfigServer: 1}));
}
st.stop();
diff --git a/jstests/noPassthrough/catalog_shard_resharding_fixture.js b/jstests/noPassthrough/catalog_shard_resharding_fixture.js
index 201159086c1..4623764eb75 100644
--- a/jstests/noPassthrough/catalog_shard_resharding_fixture.js
+++ b/jstests/noPassthrough/catalog_shard_resharding_fixture.js
@@ -1,5 +1,5 @@
/**
- * Test the ReshardingTest fixture can work with a catalogShard.
+ * Test the ReshardingTest fixture can work with a configShard.
*
* @tags: [
* requires_fcv_70,
@@ -14,7 +14,7 @@
load("jstests/sharding/libs/resharding_test_fixture.js");
const reshardingTest =
- new ReshardingTest({numDonors: 2, numRecipients: 2, reshardInPlace: true, catalogShard: true});
+ new ReshardingTest({numDonors: 2, numRecipients: 2, reshardInPlace: true, configShard: true});
reshardingTest.setup();
const ns = "reshardingDb.coll";
diff --git a/jstests/noPassthrough/catalog_shard_secondary_reads.js b/jstests/noPassthrough/catalog_shard_secondary_reads.js
index 39cc57a1950..b3a41d91661 100644
--- a/jstests/noPassthrough/catalog_shard_secondary_reads.js
+++ b/jstests/noPassthrough/catalog_shard_secondary_reads.js
@@ -1,5 +1,5 @@
/**
- * Tests catalog shard topology.
+ * Tests config shard topology.
*
* @tags: [
* requires_fcv_70,
@@ -9,7 +9,7 @@
(function() {
"use strict";
-load("jstests/libs/catalog_shard_util.js");
+load("jstests/libs/config_shard_util.js");
load("jstests/libs/fail_point_util.js");
load('jstests/libs/chunk_manipulation_util.js');
@@ -19,7 +19,7 @@ const st = new ShardingTest({
shards: {rs0: {nodes: 2}, rs1: {nodes: 2}},
config: 2,
mongos: 1,
- catalogShard: true,
+ configShard: true,
});
assert.commandWorked(st.s0.getDB('test').user.insert({_id: 1234}));
@@ -71,8 +71,8 @@ joinMoveChunk();
assert.commandWorked(st.s0.adminCommand({movePrimary: 'test', to: st.shard1.shardName}));
assert.commandWorked(st.s0.adminCommand({movePrimary: 'sharded', to: st.shard1.shardName}));
-// A catalog shard can't be removed until all range deletions have finished.
-CatalogShardUtil.waitForRangeDeletions(st.s0);
+// A config shard can't be removed until all range deletions have finished.
+ConfigShardUtil.waitForRangeDeletions(st.s0);
removeRes = assert.commandWorked(st.s0.adminCommand({transitionToDedicatedConfigServer: 1}));
assert.eq("completed", removeRes.state, tojson(removeRes));
@@ -119,7 +119,7 @@ assert.commandWorked(st.s0.adminCommand({setFeatureCompatibilityVersion: upgrade
// Need to drop the database before it can become a shard again.
assert.commandWorked(st.configRS.getPrimary().getDB('sharded').dropDatabase());
-assert.commandWorked(st.s0.adminCommand({transitionToCatalogShard: 1}));
+assert.commandWorked(st.s0.adminCommand({transitionFromDedicatedConfigServer: 1}));
assert.commandWorked(st.s0.adminCommand({movePrimary: 'test', to: st.shard0.shardName}));
assert.commandWorked(
st.s0.adminCommand({moveChunk: 'sharded.user', find: {_id: 0}, to: st.shard0.shardName}));
diff --git a/jstests/noPassthrough/change_streams_per_shard_cursor.js b/jstests/noPassthrough/change_streams_per_shard_cursor.js
index d4fcefab48d..74a4176b93d 100644
--- a/jstests/noPassthrough/change_streams_per_shard_cursor.js
+++ b/jstests/noPassthrough/change_streams_per_shard_cursor.js
@@ -7,7 +7,7 @@
(function() {
"use strict";
-load("jstests/libs/catalog_shard_util.js");
+load("jstests/libs/config_shard_util.js");
const dbName = jsTestName();
const setupShardedCluster = (shards = 1) => {
@@ -83,8 +83,8 @@ assert.commandFailedWithCode(
assert.commandFailedWithCode(assert.throws(() => pscWatch(sdb, "coll", 42)),
ErrorCodes.TypeMismatch);
-const isCatalogShardEnabled = CatalogShardUtil.isEnabledIgnoringFCV(st);
-if (!isCatalogShardEnabled) {
+const isConfigShardEnabled = ConfigShardUtil.isEnabledIgnoringFCV(st);
+if (!isConfigShardEnabled) {
// Can't open a per shard cursor on the config RS.
assert.commandFailedWithCode(assert.throws(() => pscWatch(sdb, "coll", "config")), 6273803);
}
@@ -109,7 +109,7 @@ for (let i = 1; i <= 4; i++) {
}
assert(!c.hasNext());
-if (isCatalogShardEnabled) {
+if (isConfigShardEnabled) {
// Can open a per shard cursor on the config server.
const configDB = st.s0.getDB("config");
c = pscWatch(configDB, "coll", "config", undefined /* options */, {allowToRunOnConfigDB: true});
diff --git a/jstests/noPassthrough/cluster_commands_require_cluster_node.js b/jstests/noPassthrough/cluster_commands_require_cluster_node.js
index 6366db4538e..f8df49f7987 100644
--- a/jstests/noPassthrough/cluster_commands_require_cluster_node.js
+++ b/jstests/noPassthrough/cluster_commands_require_cluster_node.js
@@ -9,7 +9,7 @@
(function() {
"use strict";
-load("jstests/libs/catalog_shard_util.js");
+load("jstests/libs/config_shard_util.js");
const kDBName = "foo";
const kCollName = "bar";
@@ -96,12 +96,12 @@ function runTestCaseExpectSuccess(conn, testCase) {
}
//
- // Cluster commands are allowed on a catalog shard enabled config server.
+ // Cluster commands are allowed on a config shard enabled config server.
//
- const isCatalogShardEnabled = CatalogShardUtil.isEnabledIgnoringFCV(st);
+ const isConfigShardEnabled = ConfigShardUtil.isEnabledIgnoringFCV(st);
for (let testCase of clusterCommandsCases) {
- if (isCatalogShardEnabled) {
+ if (isConfigShardEnabled) {
if (testCase.expectedErr) {
runTestCaseExpectFail(st.rs0.getPrimary(), testCase, testCase.expectedErr);
} else {
diff --git a/jstests/noPassthrough/dedicated_to_catalog_shard.js b/jstests/noPassthrough/dedicated_to_catalog_shard.js
index 68e2ea7f0ca..99ba72baab2 100644
--- a/jstests/noPassthrough/dedicated_to_catalog_shard.js
+++ b/jstests/noPassthrough/dedicated_to_catalog_shard.js
@@ -1,5 +1,5 @@
/**
- * Tests catalog shard topology.
+ * Tests config shard topology.
*
* @tags: [
* requires_fcv_70,
@@ -48,17 +48,17 @@ const configCS = st.configRS.getURL();
}
//
-// Catalog shard mode tests (post addShard).
+// Config shard mode tests (post addShard).
//
{
//
// Adding the config server as a shard works.
//
- assert.commandWorked(st.s.adminCommand({transitionToCatalogShard: 1}));
+ assert.commandWorked(st.s.adminCommand({transitionFromDedicatedConfigServer: 1}));
// More than once works.
- assert.commandWorked(st.s.adminCommand({transitionToCatalogShard: 1}));
- assert.commandWorked(st.s.adminCommand({transitionToCatalogShard: 1}));
+ assert.commandWorked(st.s.adminCommand({transitionFromDedicatedConfigServer: 1}));
+ assert.commandWorked(st.s.adminCommand({transitionFromDedicatedConfigServer: 1}));
// Flushing routing / db cache updates works.
flushRoutingAndDBCacheUpdates(st.configRS.getPrimary());
diff --git a/jstests/noPassthrough/transition_to_catalog_shard_feature_flag.js b/jstests/noPassthrough/transition_to_catalog_shard_feature_flag.js
index 2fff0b6b7e0..de8fb8513b6 100644
--- a/jstests/noPassthrough/transition_to_catalog_shard_feature_flag.js
+++ b/jstests/noPassthrough/transition_to_catalog_shard_feature_flag.js
@@ -1,6 +1,6 @@
/**
- * Verifies the transitionToCatalogShard feature flag guards running the catalog shard transition
- * commands.
+ * Verifies the transitionFromDedicatedConfigServer feature flag guards running the config shard
+ * transition commands.
*
* @tags: [requires_fcv_70]
*/
@@ -21,13 +21,14 @@ const st = new ShardingTest({
});
// None of the transition commands can be run on mongos or the config server.
-assert.commandFailedWithCode(st.s.adminCommand({transitionToCatalogShard: 1}),
+assert.commandFailedWithCode(st.s.adminCommand({transitionFromDedicatedConfigServer: 1}),
ErrorCodes.CommandNotFound);
assert.commandFailedWithCode(st.s.adminCommand({transitionToDedicatedConfigServer: 1}), 7368401);
const configPrimary = st.configRS.getPrimary();
-assert.commandFailedWithCode(configPrimary.adminCommand({_configsvrTransitionToCatalogShard: 1}),
- ErrorCodes.CommandNotFound);
+assert.commandFailedWithCode(
+ configPrimary.adminCommand({_configsvrTransitionFromDedicatedConfigServer: 1}),
+ ErrorCodes.CommandNotFound);
assert.commandFailedWithCode(
configPrimary.adminCommand({_configsvrTransitionToDedicatedConfigServer: 1}), 7368402);