[SERVER-28351] blacklist move_stale_mongos.js and split_stale_mongos.js from the continuous stepdown suite Created: 16/Mar/17  Updated: 06/Dec/17  Resolved: 12/May/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.2.14, 3.4.6, 3.5.7

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-29174 Make direct writes against the config... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2
Sprint: Sharding 2017-05-29
Participants:
Linked BF Score: 0

 Description   

These tests call st.configRS.awaitLastOpCommitted, which call replSetGetStatus directly against the config server. This command can fail because of config stepdowns, failing the tests.

backport to v3.4 and v3.2 needed: SERVER-23915, which adds the st.configRS.awaitLastOpCommitted statements to fix a test bug, is backported to v3.4 and v3.2.



 Comments   
Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-28351 blacklist jstests/sharding/ tests that call st.configRS.awaitLastOpCommitted from the continuous stepdown suite

(cherry picked from commit e004bee2e5f3d17238900ff60fa5fa4c08f77ed1)
Branch: v3.4
https://github.com/mongodb/mongo/commit/de969ba464dfe0e3d5ffd45dd4f5b6cec824e775

Comment by Dianna Hohensee (Inactive) [ 12/May/17 ]

Created SERVER-29174 to apply the patch in the comments above.

Comment by Dianna Hohensee (Inactive) [ 12/May/17 ]

That sounds like a great idea. I'll make another ticket for it.

Comment by Max Hirschhorn [ 12/May/17 ]

dianna.hohensee, I think we should consider doing something similar to the patch in my earlier comment to prevent this kind of issue from recurring.

Comment by Githook User [ 12/May/17 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-28351 blacklist jstests/sharding/ tests that call st.configRS.awaitLastOpCommitted from the continuous stepdown suite

(cherry picked from commit e004bee2e5f3d17238900ff60fa5fa4c08f77ed1)
Branch: v3.2
https://github.com/mongodb/mongo/commit/a66b5f3c3294aa3d0a247c508642aeefb3881b83

Comment by Githook User [ 12/May/17 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-28351 blacklist jstests/sharding/ tests that call st.configRS.awaitLastOpCommitted from the continuous stepdown suite
Branch: master
https://github.com/mongodb/mongo/commit/e004bee2e5f3d17238900ff60fa5fa4c08f77ed1

Comment by Dianna Hohensee (Inactive) [ 12/May/17 ]

Requesting backport to v3.2 for BF-5272.

Comment by Max Hirschhorn [ 17/Mar/17 ]

I ran the sharding_continuous_config_stepdown suite with the following patch to jstests/libs/override_methods/sharding_continuous_config_stepdown.js and identified some additional tests that are problematic because they talk directly to the config servers.

  • jstests/sharding/coll_epoch_test1.js
  • jstests/sharding/move_stale_mongos.js
  • jstests/sharding/shard4.js
  • jstests/sharding/shard5.js
  • jstests/sharding/split_stale_mongos.js
  • jstests/sharding/stale_mongos_updates_and_removes.js
  • jstests/sharding/zero_shard_version.js

diff --git a/jstests/libs/override_methods/sharding_continuous_config_stepdown.js b/jstests/libs/override_methods/sharding_continuous_config_stepdown.js
index 638dc8b..7d3039e 100644
--- a/jstests/libs/override_methods/sharding_continuous_config_stepdown.js
+++ b/jstests/libs/override_methods/sharding_continuous_config_stepdown.js
@@ -251,6 +251,29 @@ tracking: {verbosity: 0} }";
 
         // Start the continuous config server stepdown thread
         this.configRS.startContinuousFailover();
+
+        // We override the functions on Mongo.prototype that send data over the wire to prevent a
+        // test from running a command directly against the config servers and causing a spurious
+        // network error if it coincided with a stepdown.
+        this.configRS.nodes.forEach(function overrideConnectionMethods(node) {
+            var methodsToOverride = [
+                "find",
+                "insert",
+                "remove",
+                "runCommand",
+                "runCommandWithMetadata",
+                "update",
+            ];
+
+            methodsToOverride.forEach(function overrideMethod(name) {
+                node[name] = function throwError() {
+                    throw new Error(
+                        "Cowardly refusing to talk directly to the config servers while running" +
+                        " with the sharding_continuous_config_stepdown.js override enabled since" +
+                        " it may lead to a spurious network error.");
+                };
+            });
+        });
     };
 
     Object.extend(ShardingTest, originalShardingTest);

Generated at Thu Feb 08 04:17:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.