[SERVER-28008] Compress replies only when the request was compressed Created: 14/Feb/17  Updated: 27/Jun/22  Resolved: 24/Aug/17

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

Type: New Feature Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: neweng, platforms-interns-2017
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-25620 Compression of wire protocol for Clients Closed
is related to SERVER-27310 Add support for zlib wire protocol co... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-06-19, Platforms 2017-07-10, Platforms 2017-07-31, Platforms 2017-08-21, Platforms 2017-09-11
Participants:

 Description   

Currently when compression is enabled, and negotiated in the initial handshake, all replies from the server will be compressed, regardless if the request coming into the server was compressed or not.

There appears to be no way to toggle replies to be compressed or not.

With snappy, this isn't much of an issue as compressing small data doesn't incur "to much overhead", but its a bit weird, and with zlib, this might be counterproductive.

There should be a way for the request to determine if the reply should be compressed or not.
This might be through a field in the flagBits header for OP_COMMAND, or simply based on the originating opcode



 Comments   
Comment by Ramon Fernandez Marina [ 24/Aug/17 ]

Author:

{'username': u'acmorrow', 'name': u'Andrew Morrow', 'email': u'acm@mongodb.com'}

Message:SERVER-28008 Fix lint
Branch:master
https://github.com/mongodb/mongo/commit/f4bf96c5e77b5f9fd3ee4839926dc0adf5d7c518

Comment by Ramon Fernandez Marina [ 24/Aug/17 ]

Author:

{'username': u'acmorrow', 'name': u'Andrew Morrow', 'email': u'acm@mongodb.com'}

Message:SERVER-28008 Always reply to compressed messages with the same compressor
Branch:master
https://github.com/mongodb/mongo/commit/655d02968973aec47b63aa750dadd10386adb3c8

Comment by Jonathan Reams [ 19/Jun/17 ]

As of SERVER-29403, the server will only compress replies of the request message was compressed, although it won't compress with the exact compressor used by the request.

This could be a good candidate for a neweng ticket.

Comment by Jonathan Reams [ 16/Jun/17 ]

As part of this work we should add an integration test that makes sure the wire protocol messages sent/received are correct, and that the network counters get updated appropriately.

Generated at Thu Feb 08 04:16:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.