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

Cannot enable snappy network compression on an existing connection in MongoDB 3.4

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.24
    • Component/s: Networking
    • Labels:
      None
    • ALL

      Problem Description

      In MongoDB 3.4 with snappy network compressor enabled on the server, running isMaster a second time with snappy compression specified causes an error. The same sequence works on MongoDB 3.6.

      Steps to Reproduce

      Start a standalone MongoDB 3.4.24 instance with snappy network compression enabled in the config file. Run a mongo shell connecting to it, then run isMaster with snappy compression specified.

      Note that specifying snappy network compression with the mongo shell option --networkMessageCompressors=snappy does work.

      Here's an example:

      [spencer@centos7 repros]$ mongo --host mongodb-local.computer
      MongoDB shell version v3.4.24
      connecting to: mongodb://mongodb-local.computer:27017/
      MongoDB server version: 3.4.24
      MongoDB Enterprise > db.runCommand({isMaster: 1, compression: ["snappy"]})
      2021-02-21T13:46:03.437+0000 E QUERY    [thread1] Error: Compression algorithm specified in message is not available :
      DB.prototype._runCommandImpl@src/mongo/shell/db.js:114:16
      DB.prototype.runCommand@src/mongo/shell/db.js:125:19
      @(shell):1:1
      MongoDB Enterprise > db.runCommand({isMaster: 1})
      2021-02-21T13:46:12.216+0000 E QUERY    [thread1] Error: Compression algorithm specified in message is not available :
      DB.prototype._runCommandImpl@src/mongo/shell/db.js:114:16
      DB.prototype.runCommand@src/mongo/shell/db.js:125:19
      @(shell):1:1
      MongoDB Enterprise > show dbs
      2021-02-21T13:46:32.971+0000 E QUERY    [thread1] Error: Compression algorithm specified in message is not available :
      DB.prototype._runCommandImpl@src/mongo/shell/db.js:114:16
      DB.prototype.runCommand@src/mongo/shell/db.js:125:19
      Mongo.prototype.adminCommand@src/mongo/shell/mongo.js:67:12
      Mongo.prototype.getDBs@src/mongo/shell/mongo.js:60:15
      shellHelper.show@src/mongo/shell/utils.js:814:19
      shellHelper@src/mongo/shell/utils.js:704:15
      @(shellhelp2):1:1
      

      Expected Results

      The session will continue with snappy network compression enabled. This expected result is achieved with MongoDB 3.6.22, but fails with MongoDB 3.4.24.

      Actual Results

      See above. Not only does the isMaster cause an error, but the session is put into some kind of state where nothing works.

      Additional Notes

      Attaching log file

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            spencer.brown@mongodb.com Spencer Brown
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: