Skip to content

Commit c8633ca

Browse files
author
Misha Tyulenev
committed
SERVER-42585 use 4.2 mongos commands as a last stable binary commands
1 parent 01329fe commit c8633ca

5 files changed

+18
-37
lines changed

jstests/sharding/database_and_shard_versioning_all_commands.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ let testCases = {
438438
whatsmyuri: {skip: "executes locally on mongos (not sent to any remote node)"},
439439
};
440440

441-
commandsRemovedFromMongosIn42.forEach(function(cmd) {
442-
testCases[cmd] = {skip: "must define test coverage for 4.0 backwards compatibility"};
441+
commandsRemovedFromMongosIn44.forEach(function(cmd) {
442+
testCases[cmd] = {skip: "must define test coverage for 4.2 backwards compatibility"};
443443
});
444444

445445
class TestRunner {
@@ -574,18 +574,15 @@ class TestRunner {
574574
// After iterating through all the existing commands, ensure there were no additional
575575
// test cases that did not correspond to any mongos command.
576576
for (let key of Object.keys(testCases)) {
577-
// We have defined real test cases for commands added in 4.2/4.4 so that the test
577+
// We have defined real test cases for commands added in 4.4 so that the test
578578
// cases are exercised in the regular suites, but because these test cases can't
579579
// run in the last stable suite, we skip processing them here to avoid failing the
580-
// below assertion. We have defined "skip" test cases for commands removed in 4.2
580+
// below assertion. We have defined "skip" test cases for commands removed in 4.4
581581
// so the test case is defined in last stable suites (in which these commands still
582582
// exist on the mongos), but these test cases won't be run in regular suites, so we
583583
// skip processing them below as well.
584-
if (commandsAddedToMongosIn42.includes(key) ||
585-
commandsRemovedFromMongosIn42.includes(key)) {
586-
continue;
587-
}
588-
if (commandsAddedToMongosIn44.includes(key)) {
584+
if (commandsAddedToMongosIn44.includes(key) ||
585+
commandsRemovedFromMongosIn44.includes(key)) {
589586
continue;
590587
}
591588
assert(testCases[key].validated || testCases[key].conditional,
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1-
// These commands were removed from mongos 4.2, but will still appear in the listCommands output
2-
// of a 4.0 mongos. A last-stable mongos will be unable to run a command on a latest version shard
1+
// These commands were removed from mongos 4.4, but will still appear in the listCommands output
2+
// of a 4.2 mongos. A last-stable mongos will be unable to run a command on a latest version shard
33
// that no longer supports that command. To increase test coverage and allow us to run on same- and
44
// mixed-version suites, we allow these commands to have a test defined without always existing on
55
// the servers being used.
6-
const commandsRemovedFromMongosIn42 = [
7-
'copydb',
8-
'copydbsaslstart',
9-
'eval',
10-
'geoNear',
11-
'getPrevError',
12-
'group',
13-
'reIndex',
14-
];
15-
// These commands were added in mongos 4.2/4.4, so will not appear in the listCommands output of a
16-
// 4.0 mongos. We will allow these commands to have a test defined without always existing on the
6+
const commandsRemovedFromMongosIn44 = [];
7+
// These commands were added in mongos 4.4, so will not appear in the listCommands output of a
8+
// 4.2 mongos. We will allow these commands to have a test defined without always existing on the
179
// mongos being used.
18-
const commandsAddedToMongosIn42 = [
19-
'abortTransaction',
20-
'commitTransaction',
21-
'dropConnections',
22-
'setIndexCommitQuorum',
23-
'startRecordingTraffic',
24-
'stopRecordingTraffic',
25-
];
26-
const commandsAddedToMongosIn44 = ['refineCollectionShardKey'];
10+
const commandsAddedToMongosIn44 = ['refineCollectionShardKey'];

jstests/sharding/safe_secondary_reads_drop_recreate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ let testCases = {
305305
whatsmyuri: {skip: "does not return user data"}
306306
};
307307

308-
commandsRemovedFromMongosIn42.forEach(function(cmd) {
309-
testCases[cmd] = {skip: "must define test coverage for 4.0 backwards compatibility"};
308+
commandsRemovedFromMongosIn44.forEach(function(cmd) {
309+
testCases[cmd] = {skip: "must define test coverage for 4.2 backwards compatibility"};
310310
});
311311

312312
let scenarios = {

jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ let testCases = {
340340
whatsmyuri: {skip: "does not return user data"}
341341
};
342342

343-
commandsRemovedFromMongosIn42.forEach(function(cmd) {
344-
testCases[cmd] = {skip: "must define test coverage for 4.0 backwards compatibility"};
343+
commandsRemovedFromMongosIn44.forEach(function(cmd) {
344+
testCases[cmd] = {skip: "must define test coverage for 4.2 backwards compatibility"};
345345
});
346346

347347
// Set the secondaries to priority 0 and votes 0 to prevent the primaries from stepping down.

jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ let testCases = {
310310
whatsmyuri: {skip: "does not return user data"}
311311
};
312312

313-
commandsRemovedFromMongosIn42.forEach(function(cmd) {
314-
testCases[cmd] = {skip: "must define test coverage for 4.0 backwards compatibility"};
313+
commandsRemovedFromMongosIn44.forEach(function(cmd) {
314+
testCases[cmd] = {skip: "must define test coverage for 4.2 backwards compatibility"};
315315
});
316316

317317
// Set the secondaries to priority 0 and votes 0 to prevent the primaries from stepping down.

0 commit comments

Comments
 (0)