[CSHARP-4199] Change stream exception on update notification after some hours of usage Created: 07/Jun/22 Updated: 27/Oct/23 Resolved: 30/Jun/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 2.11.4 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Unknown |
| Reporter: | Mario Vernari | Assignee: | James Kovacs |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
| Comments |
| Comment by PM Bot [ 30/Jun/22 ] |
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. |
| Comment by James Kovacs [ 15/Jun/22 ] |
|
Hi, vernarim@libero.it, We are glad that you were able to find a solution and thank you for your question. MongoDB does advertise its supported wire versions via the hello command (formerly called isMaster). It will reply with a minWireVersion and maxWireVersion. Drivers know their supported wire versions. For example, the 2.14.0 driver - which requires MongoDB 3.6+ - has a minWireVersion of 6. If you try to connect to a MongoDB 3.4 server using the 2.14.0 driver, you would receive an error stating that the wire versions aren't compatible as the server's maxWireVersion is 5 and the driver's minWireVersion is 6. So far so good. The question now becomes why doesn't the driver raise an exception if the server's maxWireVersion is higher than the driver's? The reason is that a lot of times it doesn't matter. As long as you're not using new features introduced in later versions of MongoDB, older clients will most often work. And if you try to use a new server feature with an old driver, you will quickly know whether it works or not. You encountered a bit of an unfortunate edge case where you start an operation (a change stream) and you might not see a change stream event with the new truncatedArrays field for hours. Depending on your workload, you may never see this field. Thus we made the choice to rely on human-readable compatibility matrices rather than not allowing developers to use older drivers with newer servers. We are investing in better forward compatibility guarantees with features like the MongoDB Stable API as well as making our APIs more tolerant of future changes such as DRIVERS-1995 / Please let us know if you have any additional questions. Sincerely, |
| Comment by Boris Dogadov [ 09/Jun/22 ] |
|
Hi vernarim@libero.it, thank you for your question. .Net driver has versions range validation. We will look deeper into what the expected behaviour should be in such case. |
| Comment by Mario Vernari [ 09/Jun/22 ] |
|
Okay, the problem seems solved. It is the driver version, which is not compatible with the Atlas MongoDB version. I upgraded it to version 2.13.3 and now everything seems working fine. I had to limit to that version because the same app must connect to an old Mongo 3.4: this driver is the only able to fit practically any MongoDB version. Just a question: why don't you implement the compatibility matrix inside the driver, so that it'll raise an exception SOON when the server doesn't fit? it isn't nice allowing the connection, then having strange behaviors after the app is released. |
| Comment by Mario Vernari [ 07/Jun/22 ] |
|
Isn't a way to edit the post? the code seems now full of garbage... |