[CSHARP-2672] Fix snappy compression Created: 29/Jul/19  Updated: 28/Oct/23  Resolved: 27/Sep/19

Status: Closed
Project: C# Driver
Component/s: Wire Protocol
Affects Version/s: None
Fix Version/s: 2.9.2

Type: Bug Priority: Major - P3
Reporter: Dmitry Lukyanov (Inactive) Assignee: Vincent Kam (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-2760 All binary message encoders should ve... Closed
Case:

 Description   

The below repo with turned on `snappy` compression:

          var m = new MongoClient("mongodb://localhost?compressors=snappy");
          var coll = m.GetDatabase("test").GetCollection<BsonDocument>("foo");
          coll.InsertOne(BsonDocument.Parse("{x:1}"));

throws the server exception:

DBException handling request, closing client connection: BadValue: Compressed message was invalid or corrupted

Probably it's something about the difference in the format of `snappy` headers which are expected by the server and format which we use in the driver.

NOTE: currently `snappy` is disabled in `evergreen.yml`. It should be turned on. However when I did it, all tests related to `snappy` task passed: https://evergreen.mongodb.com/version/5d3ebf440ae6067c15be8da9
Perhaps it's not enough just to uncomment the snappy lines from here: https://github.com/mongodb/mongo-csharp-driver/blob/master/evergreen/evergreen.yml#L483. It should be also investigated.



 Comments   
Comment by Githook User [ 30/Sep/19 ]

Author:

{'name': 'vincentkam', 'username': 'vincentkam', 'email': 'vincent.kam@10gen.com'}

Message: CSHARP-2672: Fix snappy compression
Branch: v2.9.x
https://github.com/mongodb/mongo-csharp-driver/commit/8f5fadaaeb84e59c77001a5ed129998346bc0802

Comment by Githook User [ 27/Sep/19 ]

Author:

{'username': 'vincentkam', 'email': 'vincent.kam@10gen.com', 'name': 'vincentkam'}

Message: CSHARP-2672: Fix snappy compression
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/1f91e976cf898822e9058cd43be60c7f664e456f

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