[SERVER-44308] Fix call to _flushRoutingTableCacheUpdates for sessions collection in shardingtest.js Created: 29/Oct/19  Updated: 29/Oct/23  Resolved: 13/Dec/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.3

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-42866 Trigger a logical session cache refre... Closed
is related to SERVER-44745 Trigger a logical session cache refre... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-12-16
Participants:
Linked BF Score: 8

 Description   

Found while looking through logs for something unrelated. SERVER-42866 added calls to _flushRoutingTableCacheUpdatesCmd, but it should be _flushRoutingTableCacheUpdates (no "Cmd"). Also, the command argument should be "config.system.sessions", and we should assert that the command worked.

I think the following patch should fix it:

diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index a87e1bfc57..459a40f24b 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -1658,9 +1658,11 @@ var ShardingTest = function(params) {
         for (let i = 0; i < numShards; i++) {
             if (otherParams.rs || otherParams["rs" + i] || startShardsAsRS) {
                 const rs = this._rs[i].test;
-                rs.getPrimary().getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1});
+                assert.commandWorked(rs.getPrimary().getDB("admin").runCommand(
+                    {_flushRoutingTableCacheUpdates: "config.system.sessions"}));
             } else {
-                this["shard" + i].getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1});
+                assert.commandWorked(this["shard" + i].getDB("admin").runCommand(
+                    {_flushRoutingTableCacheUpdates: "config.system.sessions"}));
             }
         }
     }



 Comments   
Comment by Githook User [ 13/Dec/19 ]

Author:

{'name': 'Haley Connelly', 'email': 'haley.connelly@10gen.com', 'username': 'haleyConnelly'}

Message: SERVER-44308 Fix call to _flushRoutingTableCacheUpdates for sessions collection in shardingtest.js
Branch: master
https://github.com/mongodb/mongo/commit/6c246fa1b8b7dc1d47d138be4650e0e70dc12060

Generated at Thu Feb 08 05:05:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.