SERVER-125024 Turn off replicated size and count for incompatible tests temporarily (#52335)

GitOrigin-RevId: 03c9cf93fb19ba39913576094c92aab06f53c852
This commit is contained in:
Yuhong Zhang 2026-04-23 18:37:30 -04:00 committed by MongoDB Bot
parent c94577b041
commit 7a658e7fe0
37 changed files with 370 additions and 38 deletions

View File

@ -145,6 +145,9 @@ executor:
analyzeShardKeyNumRanges: 10
analyzeShardKeySplitPointExpirationSecs: 10
ttlMonitorSleepSecs: 5
# TODO (SERVER-124153): Remove the failpoint.
failpoint.useInMemoryReplicatedSizeCount:
mode: alwaysOn
logComponentVerbosity:
verbosity: 0
sharding: 2

View File

@ -6,6 +6,13 @@
// # Serverless does not support $out
// command_not_supported_in_serverless,
// ]
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const localDB = db.getSiblingDB(`${jsTestName()}` + "_local_db");
const outputDBName = `${jsTestName()}` + "_output_db";

View File

@ -3,6 +3,13 @@
// does_not_support_transactions,
// ]
import {dropWithoutImplicitRecreate} from "jstests/aggregation/extras/merge_helpers.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
// Setup and populate input collection.
const inputName = "out_preserve_coll_options";

View File

@ -8,6 +8,12 @@ import {dropWithoutImplicitRecreate} from "jstests/aggregation/extras/merge_help
import {assertErrorCode} from "jstests/aggregation/extras/utils.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const coll = db.source;
const targetCollName = "target";
coll.drop();

View File

@ -14,8 +14,6 @@
* incompatible_tsan,
* # TODO(SERVER-119777): Ensure test does not leak cursors.
* can_leak_idle_cursors,
* # TODO (SERVER-124153): Re-enable this test.
* featureFlagReplicatedFastCount_incompatible,
* ]
*/
import {interruptedQueryErrors} from "jstests/concurrency/fsm_libs/assert.js";
@ -1077,6 +1075,13 @@ export const $config = extendWorkload(kBaseConfig, function ($config, $super) {
// The body of the workload.
$config.setup = function setup(db, collName, cluster) {
// TODO (SERVER-124153): Remove the failpoint.
cluster.executeOnMongodNodes((adminDb) => {
assert.commandWorked(
adminDb.runCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"}),
);
});
// Look up the number of most common values and the number of ranges that the
// analyzeShardKey command should return.
cluster.executeOnMongodNodes((db) => {
@ -1139,6 +1144,13 @@ export const $config = extendWorkload(kBaseConfig, function ($config, $super) {
};
$config.teardown = function teardown(db, collName, cluster) {
// TODO (SERVER-124153): Remove the failpoint.
cluster.executeOnMongodNodes((adminDb) => {
assert.commandWorked(
adminDb.runCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "off"}),
);
});
if (cluster.isSharded) {
cluster.executeOnMongosNodes((adminDb) => {
configureFailPoint(adminDb, "queryAnalysisSamplerFilterByComment", {}, "off");

View File

@ -7,8 +7,6 @@
* @tags: [
* requires_sharding,
* assumes_balancer_off,
* # TODO (SERVER-124037): Re-enable this test.
* featureFlagReplicatedFastCount_incompatible,
* ]
*/
import {extendWorkload} from "jstests/concurrency/fsm_libs/extend_workload.js";
@ -22,6 +20,26 @@ export const $config = extendWorkload($baseConfig, function ($config, $super) {
$config.data.partitionSize = 100; // number of shard key values
// TODO (SERVER-124153): Remove the failpoint.
const originalSetup = $config.setup;
$config.setup = function setup(db, collName, cluster) {
originalSetup.call(this, db, collName, cluster);
cluster.executeOnMongodNodes(function (adminDb) {
assert.commandWorked(
adminDb.runCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"}),
);
});
};
$config.teardown = function teardown(db, collName, cluster) {
cluster.executeOnMongodNodes(function (adminDb) {
assert.commandWorked(
adminDb.runCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "off"}),
);
});
};
// Split a random chunk in this thread's partition, and verify that each node
// in the cluster affected by the splitChunk operation sees the appropriate
// after-state regardless of whether the operation succeeded or failed.

View File

@ -9,7 +9,17 @@
// does_not_support_causal_consistency,
// ]
import {ClusteredCollectionUtil} from "jstests/libs/clustered_collections/clustered_collection_util.js";
import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124148): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
function serverIsMongos() {
const res = db.runCommand("hello");
@ -56,12 +66,9 @@ if (isMongoS) {
assert.commandWorked(dbStats);
}
// TODO(SERVER-124148): Remove feature flag check.
if (!FeatureFlagUtil.isPresentAndEnabled(testDB, "featureFlagReplicatedFastCount")) {
assert.eq(1, dbStats.objects, tojson(dbStats));
assert.eq(dataSize, dbStats.avgObjSize, tojson(dbStats));
assert.eq(dataSize, dbStats.dataSize, tojson(dbStats));
}
assert.eq(1, dbStats.objects, tojson(dbStats));
assert.eq(dataSize, dbStats.avgObjSize, tojson(dbStats));
assert.eq(dataSize, dbStats.dataSize, tojson(dbStats));
// Index count will vary on mongoS if an additional index is needed to support sharding.
if (isMongoS) {

View File

@ -11,8 +11,6 @@
// requires_collstats,
// requires_fastcount,
// no_selinux,
// # TODO(SERVER-124153): Remove this tag.
// featureFlagReplicatedFastCount_incompatible,
// ]
// -------------------------
@ -31,6 +29,16 @@
import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
let assertChunkSizes = function (splitVec, numDocs, maxChunkSize, msg) {
splitVec = [{x: -1}].concat(splitVec);
splitVec.push({x: numDocs + 1});

View File

@ -13,6 +13,17 @@
// ]
import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js";
import {getAggPlanStages, getPlanStages} from "jstests/libs/query/analyze_plan.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
const isHintsToQuerySettingsSuite = TestData.isHintsToQuerySettingsSuite || false;

View File

@ -7,12 +7,21 @@
* assumes_read_preference_unchanged,
* assumes_unsharded_collection,
* uses_api_parameters,
* # TODO(SERVER-124193): Remove this tag.
* featureFlagReplicatedFastCount_incompatible,
* ]
*/
import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124193): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
// This test makes assertions about sessions on a particular node, which are not compatible with
// random mongos dispatching.

View File

@ -20,14 +20,24 @@
* # moveCollection (used by random_migrations suites) recreates the collection on the destination
* # shard with an empty plan cache, which would cause plan cache assertions to fail mid-test.
* assumes_stable_collection_uuid,
* # TODO(SERVER-124265): Remove.
* featureFlagReplicatedFastCount_incompatible,
* ]
*/
import {getCachedPlanForQuery} from "jstests/libs/query/analyze_plan.js";
import {getCBRConfig, setCBRConfigOnAllNonConfigNodes} from "jstests/libs/query/cbr_utils.js";
import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124265): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnAllShards({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
primaryNodeOnly: false,
});
}
if (checkSbeFullyEnabled(db)) {
jsTest.log.info("Skipping test because the SBE plan cache is enabled");

View File

@ -14,6 +14,16 @@
*/
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
// The test sets a failpoint on a specific mongos and expects subsequent commands to hit that same mongos.
// Certain tasks (such as "sharding_jscore...") may use test fixtures with multiple mongos.
// pinToSingleMongos due to configureFailPoint command.
@ -132,9 +142,6 @@ assert.commandWorked(
assert.commandWorked(testDB.runCommand({ping: 1}));
assert.commandWorked(adminDB.runCommand({configureFailPoint: "failCommand", mode: "off"}));
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
// Test failpoint with errorMsg
assert.commandWorked(

View File

@ -101,6 +101,6 @@ TimeseriesTest.run((insert) => {
),
);
assert.eq(0, coll.find({"meta": "a"}).toArray().length);
assert.eq(0, coll.stats().timeseries.bucketCount);
assert.eq(0, getTimeseriesCollForRawOps(coll).count({}, kRawOperationSpec));
assert.eq(0, coll.find({"meta": "b"}).toArray().length);
});

View File

@ -2,6 +2,13 @@
// @tags: [uses_transactions, uses_snapshot_read_concern, references_foreign_collection]
// TODO (SERVER-39704): Remove the following load after SERVER-39704 is completed
import {withTxnAndAutoRetryOnMongos} from "jstests/libs/auto_retry_transaction_in_sharding.js"; // For isSharded.
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const session = db.getMongo().startSession({causalConsistency: false});
const testDB = session.getDatabase("test");
@ -130,3 +137,8 @@ assert.commandFailedWithCode(session.abortTransaction_forTesting(), ErrorCodes.N
session.startTransaction({readConcern: {level: "snapshot"}});
assert.throws(() => coll.aggregate({$indexStats: {}}).next());
assert.commandFailedWithCode(session.abortTransaction_forTesting(), ErrorCodes.NoSuchTransaction);
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "off"},
});

View File

@ -7,6 +7,15 @@
* uses_transactions
* ]
*/
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const dbName = "test";
const collName = "default_read_concern";
const testDB = db.getSiblingDB(dbName);

View File

@ -6,6 +6,13 @@
// uses_transactions,
// uses_parallel_shell
// ]
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const dbName = "test";
const collName = "kill_sessions_kills_transaction";

View File

@ -7,6 +7,14 @@
// uses_transactions
// ]
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const dbName = "test";
const collName = "many_txns";
const numTxns = 150;

View File

@ -17,6 +17,17 @@ import {
testExistingUnshardedCollection,
testNonExistingCollection,
} from "jstests/sharding/analyze_shard_key/libs/analyze_shard_key_common_tests.js";
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
FixtureHelpers.runCommandOnAllShards({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
}
const shardNames = db.adminCommand({listShards: 1}).shards.map((shard) => shard._id);

View File

@ -79,6 +79,8 @@ function createShardingTest(mongos = 1, shards = 3, rsNodes = 1, configShard = f
setParameter: {
writePeriodicNoops: true,
periodicNoopIntervalSecs: 1,
// TODO (SERVER-125025): remove the failpoint.
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
},
other: {

View File

@ -4,8 +4,6 @@
* @tags: [
* requires_replication,
* requires_sharding,
* # TODO SERVER-124178: Revisit this tag.
* featureFlagReplicatedFastCount_incompatible,
* ]
*/
import {ReplSetTest} from "jstests/libs/replsettest.js";
@ -26,7 +24,15 @@ function getShardCount(counts, shardName) {
* on the i-th shard or no chunks assigned to that shard if shardDistribution[i] is null.
*/
function runShardingTestExists(shardDistribution) {
const st = new ShardingTest({shards: shardDistribution.length});
// TODO (SERVER-124178): Remove the failpoint.
const st = new ShardingTest({
shards: shardDistribution.length,
rsOptions: {
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
},
});
const mongos = st.s0;
const admin = mongos.getDB("admin");
@ -81,7 +87,15 @@ function runShardingTestExists(shardDistribution) {
}
function runUnshardedCollectionShardTestExists(shardNum, docsNum) {
const st = new ShardingTest({shards: shardNum});
// TODO (SERVER-124153): Remove the failpoint.
const st = new ShardingTest({
shards: shardNum,
rsOptions: {
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
},
});
const mongos = st.s0;
const admin = mongos.getDB("admin");
@ -106,7 +120,15 @@ function runUnshardedCollectionShardTestExists(shardNum, docsNum) {
function runReplicaSetTestExists(nodesNum, docsNum) {
const namespace = dbName + "." + collName;
const rst = new ReplSetTest({nodes: nodesNum});
// TODO (SERVER-124153): Remove the failpoint.
const rst = new ReplSetTest({
nodes: nodesNum,
nodeOptions: {
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
},
});
rst.startSet();
rst.initiate();
@ -129,7 +151,12 @@ function runReplicaSetTestExists(nodesNum, docsNum) {
function runStandaloneTestExists(docsNum) {
const namespace = dbName + "." + collName;
const conn = MongoRunner.runMongod({});
// TODO (SERVER-124153): Remove the failpoint.
const conn = MongoRunner.runMongod({
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
});
const coll = conn.getCollection(namespace);

View File

@ -4,6 +4,13 @@
import {ShardingTest} from "jstests/libs/shardingtest.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const chunkSizeMB = 1;
let st = new ShardingTest({
shards: 3,
@ -11,6 +18,7 @@ let st = new ShardingTest({
// Set global max chunk size to 1MB
chunkSize: chunkSizeMB,
},
rsOptions: {setParameter: failpointSetParameter},
});
function runBalancer() {

View File

@ -12,10 +12,17 @@ import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js";
const rangeDeleterBatchSize = 50;
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
other: {
enableBalancer: false,
rsOptions: {setParameter: {rangeDeleterBatchSize: rangeDeleterBatchSize}},
rsOptions: {setParameter: {rangeDeleterBatchSize: rangeDeleterBatchSize, ...failpointSetParameter}},
},
});

View File

@ -78,7 +78,14 @@ function createRangeDeletionTask(st, shardPrimary, toShardName, chunkToMove) {
assert.commandWorked(st.s.adminCommand({moveChunk: ns, find: chunkToMove, to: toShardName}));
}
const st = new ShardingTest({shards: 3});
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({shards: 3, rsOptions: {setParameter: failpointSetParameter}});
assert.commandWorked(st.s.adminCommand({enableSharding: dbName, primaryShard: st.shard0.shardName}));
assert.commandWorked(st.s.adminCommand({shardCollection: ns, key: {_id: 1}}));

View File

@ -626,6 +626,7 @@ export function InternalTransactionChunkMigrationTest() {
jsTest.log("Finished retrying retryable internal transactions after migration1");
}
this.st = st;
this.InternalTxnType = kInternalTxnType;
// Helpers for testing retryable internal transactions with chunk migration. Each helper defines

View File

@ -8,6 +8,20 @@
import {InternalTransactionChunkMigrationTest} from "jstests/sharding/internal_txns/libs/chunk_migration_test.js";
const transactionTest = new InternalTransactionChunkMigrationTest();
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
for (let i = 0; i < 3; i++) {
assert.commandWorked(
transactionTest.st[`rs${i}`]
.getPrimary()
.adminCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"}),
);
}
}
transactionTest.runTestForFindAndModifyDuringChunkMigration(
transactionTest.InternalTxnType.kRetryable,
false /* abortOnInitialTry */,

View File

@ -11,6 +11,13 @@ import {TxnUtil} from "jstests/libs/txns/txn_util.js";
import {awaitRSClientHosts} from "jstests/replsets/rslib.js";
import {makeCommitTransactionCmdObj} from "jstests/sharding/libs/sharded_transactions_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
shards: 1,
rs: {nodes: 2},
@ -19,6 +26,7 @@ const st = new ShardingTest({
// an election when they do not detect an active primary. Therefore, we are setting the
// electionTimeoutMillis to its default value.
initiateWithDefaultElectionTimeout: true,
rsOptions: {setParameter: failpointSetParameter},
});
const kDbName = "testDb";

View File

@ -14,7 +14,14 @@ import {ShardingTest} from "jstests/libs/shardingtest.js";
import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js";
import {ShardVersioningUtil} from "jstests/sharding/libs/shard_versioning_util.js";
const st = new ShardingTest({shards: 2, other: {chunkSize: 1}});
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({shards: 2, other: {chunkSize: 1}, rsOptions: {setParameter: failpointSetParameter}});
const configDB = st.s.getDB("config");
// Resets database dbName and enables sharding and establishes shard0 as primary, test case agnostic

View File

@ -10,7 +10,19 @@ import {ShardingTest} from "jstests/libs/shardingtest.js";
import {chunkBoundsUtil} from "jstests/sharding/libs/chunk_bounds_util.js";
import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js";
const st = new ShardingTest({mongos: 1, shards: 2, chunkSize: 1});
// TODO (SERVER-124153): Remove the failpoint.
const st = new ShardingTest({
mongos: 1,
shards: 2,
chunkSize: 1,
other: {
shardOptions: {
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": "{'mode':'alwaysOn'}",
},
},
},
});
const kDbName = "db";
const mongos = st.s0;

View File

@ -10,8 +10,15 @@
import {ShardingTest} from "jstests/libs/shardingtest.js";
import {addShardToCluster} from "jstests/libs/query/change_stream_util.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const rsNodeOptions = {
setParameter: {writePeriodicNoops: true, periodicNoopIntervalSecs: 1},
setParameter: {writePeriodicNoops: true, periodicNoopIntervalSecs: 1, ...failpointSetParameter},
};
const st = new ShardingTest({shards: 1, mongos: 1, rs: {nodes: 1}, other: {rsOptions: rsNodeOptions}});

View File

@ -12,10 +12,19 @@ import {ReplSetTest} from "jstests/libs/replsettest.js";
import {ShardingTest} from "jstests/libs/shardingtest.js";
import {shardCollectionMoveChunks} from "jstests/sharding/libs/update_shard_key_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
mongos: 1,
shards: {rs0: {nodes: 3}, rs1: {nodes: 3}},
rsOptions: {setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS}},
rsOptions: {
setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS, ...failpointSetParameter},
},
});
const kDbName = "db";

View File

@ -34,10 +34,19 @@ import {
shardCollectionMoveChunks,
} from "jstests/sharding/libs/update_shard_key_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
mongos: 1,
shards: {rs0: {nodes: 3}, rs1: {nodes: 3}},
rsOptions: {setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS}},
rsOptions: {
setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS, ...failpointSetParameter},
},
});
const kDbName = "db";

View File

@ -28,11 +28,21 @@ import {
shardCollectionMoveChunks,
} from "jstests/sharding/libs/update_shard_key_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
mongos: 1,
shards: {rs0: {nodes: 3}, rs1: {nodes: 3}},
rsOptions: {setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS}},
rsOptions: {
setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS, ...failpointSetParameter},
},
});
const kDbName = "db";
const ns = kDbName + ".foo";
const mongos = st.s0;

View File

@ -21,11 +21,21 @@ import {
assertCanUpdatePrimitiveShardKey,
} from "jstests/sharding/libs/update_shard_key_helpers.js";
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
mongos: 1,
shards: {rs0: {nodes: 3}, rs1: {nodes: 3}},
rsOptions: {setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS}},
rsOptions: {
setParameter: {maxTransactionLockRequestTimeoutMillis: ReplSetTest.kDefaultTimeoutMS, ...failpointSetParameter},
},
});
const kDbName = "db";
const mongos = st.s0;
const shard0 = st.shard0.shardName;

View File

@ -153,7 +153,16 @@ function runMoveChunkReplicaRecordIDsTest(collName, keyDoc, useBounds, splitChun
);
}
const st = new ShardingTest({mongos: 1, shards: 2});
// TODO (SERVER-124153): Remove the failpoint.
const st = new ShardingTest({
mongos: 1,
shards: 2,
rsOptions: {
setParameter: {
"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"}),
},
},
});
const dbName = "test";
const mongos = st.s0;

View File

@ -36,6 +36,19 @@ const maxShardBytesWithoutDataField = 256;
const reshardingTest = new ReshardingTest({numDonors: 2, numRecipients: 2, reshardInPlace: true});
reshardingTest.setup();
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
if (!isMultiversion) {
for (let i = 0; i < 2; i++) {
reshardingTest._st[`rs${i}`].nodes.forEach((node) => {
assert.commandWorked(
node.adminCommand({configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"}),
);
});
}
}
const donorShardNames = reshardingTest.donorShardNames;
const inputCollection = reshardingTest.createShardedCollection({
ns: ns,

View File

@ -12,7 +12,21 @@ import {
updateZoneKeyRange,
} from "jstests/sharding/libs/zone_changes_util.js";
const st = new ShardingTest({shards: 3, other: {chunkSize: 1}});
// TODO (SERVER-124153): Remove the failpoint.
const isMultiversion =
Boolean(jsTest.options().useRandomBinVersionsWithinReplicaSet) || Boolean(TestData.multiversionBinVersion);
const failpointSetParameter = isMultiversion
? {}
: {"failpoint.useInMemoryReplicatedSizeCount": tojson({mode: "alwaysOn"})};
const st = new ShardingTest({
shards: 3,
other: {
chunkSize: 1,
},
rsOptions: {setParameter: failpointSetParameter},
});
let primaryShard = st.shard0;
let dbName = "test";
let testDB = st.s.getDB(dbName);

View File

@ -9,6 +9,12 @@
import {FixtureHelpers} from "jstests/libs/fixture_helpers.js";
import {createSearchIndex, dropSearchIndex} from "jstests/libs/query_integration_search/search.js";
// TODO (SERVER-124153): Remove the failpoint.
FixtureHelpers.runCommandOnEachPrimary({
db: db.getSiblingDB("admin"),
cmdObj: {configureFailPoint: "useInMemoryReplicatedSizeCount", mode: "alwaysOn"},
});
const testDb = db.getSiblingDB(jsTestName());
const coll = testDb.underlyingSourceCollection;
coll.drop();