[SERVER-55018] Cannot enable snappy network compression on an existing connection in MongoDB 3.4 Created: 06/Mar/21  Updated: 10/Mar/21  Resolved: 10/Mar/21

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: 3.4.24
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Spencer Brown Assignee: Eric Sedor
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File m.log.tar-1.gz    
Issue Links:
Problem/Incident
Operating System: ALL
Participants:

 Description   

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



 Comments   
Comment by Eric Sedor [ 10/Mar/21 ]

MongoDB version 3.4 reached end of life on January 2020. Since this is an edge-case affecting on-the-fly changes to network compression on standalone nodes, and is behaving as expected in 3.6, we're not going to pursue a fix at this time.

Comment by Oleg Pudeyev (Inactive) [ 07/Mar/21 ]

As I understand it this issue shouldn't affect drivers since they are supposed to negotiate compression as part of the initial handshake, which does appear to work on 3.4 for snappy.

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