diff options
author | Yoonsoo Kim <yoonsoo.kim@mongodb.com> | 2022-04-07 14:48:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-07 16:13:36 +0000 |
commit | 50d15d6ce470f7e27fe753953b106ffa5ee096f5 (patch) | |
tree | 3a1e68365eb2555b818f5179f6aa3ef286c57b72 /jstests/multiVersion | |
parent | 65656c587aeb384c173be1b84d0b3057563417f4 (diff) | |
download | mongo-50d15d6ce470f7e27fe753953b106ffa5ee096f5.tar.gz |
SERVER-65311 Get connections to shards manually to fix connection issue
Diffstat (limited to 'jstests/multiVersion')
-rw-r--r-- | jstests/multiVersion/targetedTestsLastContinuousFeatures/accumulator_fix_last_continuous.js | 22 | ||||
-rw-r--r-- | jstests/multiVersion/targetedTestsLastLtsFeatures/accumulator_fix_last_lts.js | 24 |
2 files changed, 26 insertions, 20 deletions
diff --git a/jstests/multiVersion/targetedTestsLastContinuousFeatures/accumulator_fix_last_continuous.js b/jstests/multiVersion/targetedTestsLastContinuousFeatures/accumulator_fix_last_continuous.js index 20350664ebb..e63b1d69b59 100644 --- a/jstests/multiVersion/targetedTestsLastContinuousFeatures/accumulator_fix_last_continuous.js +++ b/jstests/multiVersion/targetedTestsLastContinuousFeatures/accumulator_fix_last_continuous.js @@ -26,24 +26,26 @@ load('jstests/multiVersion/libs/multi_cluster.js'); // For upgradeCluster() assert.commandWorked(st.s0.adminCommand({enableSharding: db.getName()})); let verifyShardedAccumulatorResultsOnBothEngine = (coll, pipeline, verifyThis) => { - const dbAtShard0 = st.shard0.getDB(jsTestName()); - const dbAtShard1 = st.shard1.getDB(jsTestName()); + const dbs = [ + st.rs0.getPrimary().getDB(jsTestName()), + st.rs0.getSecondary().getDB(jsTestName()), + st.rs1.getPrimary().getDB(jsTestName()), + st.rs1.getSecondary().getDB(jsTestName()) + ]; // Turns to the classic engine at the shards. - assert.commandWorked( - dbAtShard0.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true})); - assert.commandWorked( - dbAtShard1.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true})); + dbs.forEach((db) => assert.commandWorked( + db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false}), + `at node ${db.getMongo().host}`)); // Verifies that the classic engine's results are same as the expected results. const classicRes = coll.aggregate(pipeline).toArray(); verifyThis(classicRes); // Turns to the SBE engine at the shards. - assert.commandWorked( - dbAtShard0.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false})); - assert.commandWorked( - dbAtShard1.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false})); + dbs.forEach((db) => assert.commandWorked( + db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true}), + `at node ${db.getMongo().host}`)); // Verifies that the SBE engine's results are same as the expected results. const sbeRes = coll.aggregate(pipeline).toArray(); diff --git a/jstests/multiVersion/targetedTestsLastLtsFeatures/accumulator_fix_last_lts.js b/jstests/multiVersion/targetedTestsLastLtsFeatures/accumulator_fix_last_lts.js index d4021da6f94..e8d4bf71c14 100644 --- a/jstests/multiVersion/targetedTestsLastLtsFeatures/accumulator_fix_last_lts.js +++ b/jstests/multiVersion/targetedTestsLastLtsFeatures/accumulator_fix_last_lts.js @@ -27,16 +27,20 @@ load('jstests/multiVersion/libs/multi_cluster.js'); // For upgradeCluster() let verifyShardedAccumulatorResultsOnBothEngine = (isGreaterLastContinous, coll, pipeline, verifyThis) => { - const dbAtShard0 = st.shard0.getDB(jsTestName()); - const dbAtShard1 = st.shard1.getDB(jsTestName()); + const dbs = [ + st.rs0.getPrimary().getDB(jsTestName()), + st.rs0.getSecondary().getDB(jsTestName()), + st.rs1.getPrimary().getDB(jsTestName()), + st.rs1.getSecondary().getDB(jsTestName()) + ]; // In the last-lts, we don't have the 'internalQueryForceClassicEngine' query knob. if (isGreaterLastContinous) { // Turns to the classic engine at the shards. - assert.commandWorked(dbAtShard0.adminCommand( - {setParameter: 1, internalQueryForceClassicEngine: true})); - assert.commandWorked(dbAtShard1.adminCommand( - {setParameter: 1, internalQueryForceClassicEngine: true})); + dbs.forEach( + (db) => assert.commandWorked( + db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: false}), + `at node ${db.getMongo().host}`)); } // Verifies that the classic engine's results are same as the expected results. @@ -47,10 +51,10 @@ load('jstests/multiVersion/libs/multi_cluster.js'); // For upgradeCluster() // nor the SBE $group pushdown feature. if (isGreaterLastContinous) { // Turns to the SBE engine at the shards. - assert.commandWorked(dbAtShard0.adminCommand( - {setParameter: 1, internalQueryForceClassicEngine: false})); - assert.commandWorked(dbAtShard1.adminCommand( - {setParameter: 1, internalQueryForceClassicEngine: false})); + dbs.forEach( + (db) => assert.commandWorked( + db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true}), + `at node ${db.getMongo().host}`)); // Verifies that the SBE engine's results are same as the expected results. const sbeRes = coll.aggregate(pipeline).toArray(); |