Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44308

Fix call to _flushRoutingTableCacheUpdates for sessions collection in shardingtest.js

    • Fully Compatible
    • Sharding 2019-12-16
    • 8

      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"}));
                   }
               }
           }
      

            Assignee:
            haley.connelly@mongodb.com Haley Connelly
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: