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

Fix call to _flushRoutingTableCacheUpdates for sessions collection in shardingtest.js

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2019-12-16
    • 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"}));
                   }
               }
           }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              haley.connelly Haley Connelly
              Reporter:
              esha.maharishi Esha Maharishi
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: