mongo/jstests/sharding/cluster_server_parameter_commands_sharded.js
Joan Bruguera Micó (at MongoDB) 462125b914 SERVER-93727 Review cluster server parameter elegibility logic in cluster_server_parameter_utils JS test library (#28237)
GitOrigin-RevId: 9408093daa7154c00188e8aca79f66dcc320a1d1
2024-10-21 20:05:02 +00:00

44 lines
1.2 KiB
JavaScript

/**
* Checks that set/getClusterParameter runs as expected on sharded clusters.
*
* @tags: [
* does_not_support_stepdowns,
* requires_replication,
* requires_sharding,
* ]
*/
import {
setupSharded,
testGetClusterParameterStar,
testInvalidClusterParameterCommands,
testValidClusterParameterCommands,
} from "jstests/libs/cluster_server_parameter_utils.js";
import {ShardingTest} from "jstests/libs/shardingtest.js";
// Tests that set/getClusterParameter works on all nodes of a sharded cluster.
const options = {
mongos: 1,
config: 1,
shards: 3,
rs: {
nodes: 3,
},
};
const st = new ShardingTest(options);
// Setup the necessary logging on mongos and the shards.
setupSharded(st);
// First, ensure that incorrect usages of set/getClusterParameter fail appropriately on mongos
// and cluster mongods.
testInvalidClusterParameterCommands(st);
// Then, ensure that set/getClusterParameter set and retrieve the expected values on mongos
// and the majority of nodes on all replica sets in the cluster.
testValidClusterParameterCommands(st);
// Ensure that getClusterParameter: "*" works as expected.
testGetClusterParameterStar(st);
st.stop();