SERVER-122290 Use 3-node replica set to stabilize timeseries_dollar_prefixed_timefield_errors.js (#50251)

GitOrigin-RevId: fcbc78f515cacadffe9cbb22c5d38ec62c76a6f2
This commit is contained in:
Daniel Segel 2026-03-25 13:43:18 -04:00 committed by MongoDB Bot
parent 711b8cf20d
commit eccf1d6f34
2 changed files with 11 additions and 10 deletions

View File

@ -136,14 +136,16 @@ function assertCollectionsQueryable(db) {
}
testPerformReplSetRollingRestart({
// support for $-prefixed timeField/metaField was removed in 8.3
// Support for $-prefixed timeField/metaField was removed in v8.3.
startingVersion: {binVersion: "last-lts"},
setupFn: setUp,
beforeRestart: () => {},
afterSecondariesHaveRestarted: (primaryConnection, originalPrimary) => {
// Create on the node that wasn't restarted (still on last-lts).
assertCreateDollarCollectionsWorks(getDB(originalPrimary));
assertCollectionsQueryable(getDB(primaryConnection));
afterSecondariesHaveRestarted: (primaryConnection) => {
// Check that collections can be created and queried while secondaries are on the new
// version and primaries are on the old version.
const db = getDB(primaryConnection);
assertCreateDollarCollectionsWorks(db);
assertCollectionsQueryable(db);
},
afterPrimariesHaveRestarted: (primaryConnection) => {
const db = getDB(primaryConnection);

View File

@ -52,6 +52,9 @@ export function testPerformReplSetRollingRestart({
{
...startingVersion,
},
{
...startingVersion,
},
],
// Create a copy of the options since the callee may modify them.
nodeOptions: copyJSON(startingNodeOptions),
@ -76,15 +79,11 @@ export function testPerformReplSetRollingRestart({
" and options " +
tojsononeline(restartNodeOptions),
);
// Save a reference to the node that was primary before restarting secondaries. Pass it to the
// callback so tests can run operations that only the old version supports; the current primary
// after upgradeSecondaries() may be the restarted node in a 2-node set.
const originalPrimary = primaryConnection;
rst.upgradeSecondaries({...restartVersion, ...copyJSON(restartNodeOptions)});
primaryConnection = rst.getPrimary();
jsTest.log.info("Calling the afterSecondariesHaveRestarted function");
afterSecondariesHaveRestarted(primaryConnection, originalPrimary);
afterSecondariesHaveRestarted(primaryConnection);
// TODO SERVER-109457 Try a scenario where you force election here so that the restarted
// secondary could become primary while another active secondary has not restarted yet. This