[CDRIVER-3203] Choose compressors based on order presented, not order from server reply Created: 24/Jun/19  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-2930 Add support for Zstandard compression Closed

 Description   

The OP_COMPRESSED spec states

When compressing, clients MUST use the first compressor in the client's configured compressors list that is also in the servers list.

But the compressor to useĀ is retrieved from the server description which is set directly from the isMaster reply. So we always take preference of whatever order the compressors are in the server reply.

In practice, this may not be an issue currently. As I have not been able to reproduce any case where the server returns compressors in an order different from the client. But if that behavior changes in the future, we'd be using a lower priority compressor than what the client requested.


Generated at Wed Feb 07 21:17:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.