[CDRIVER-2466] retryWrites URI option silently ignored if crypto is not available Created: 22/Jan/18  Updated: 28/Oct/23  Resolved: 23/Jan/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.9.2
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: Jeremy Mikola Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-3039 Do not warn if retryWrites=false and ... Closed
is related to PHPC-1100 Fix test failures when driver is comp... Closed

 Description   

While testing the PHP driver when compiled without SSL for PHPC-1100, I noticed that casual consistency tests generally produce the following error:

Could not generate UUID for logical session id, we need a cryptography library like libcrypto, Common Crypto, or CNG

However, no such error is produced when retryWrites=true is specified. Rather, libmongoc silently omits the transaction ID from otherwise eligible write commands.



 Comments   
Comment by Githook User [ 23/Jan/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CDRIVER-2466 warn about retryWrites w/o crypto lib
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5a4e8386011c6854790b5966140c30b81cefa9f2

Comment by Jeremy Mikola [ 23/Jan/18 ]

I would suggest logging a warning at the very least.

As a developer, I think an error would be helpful, but understand if you'd rather not. The other scenarios (old server, standalone, multi-update) all seem temporal and could change based on the server, whereas missing a crypto library means this feature will never work (I'm assuming retryable writes needing sessions and sessions needing crypto is not subject to change).

Comment by A. Jesse Jiryu Davis [ 23/Jan/18 ]

We can't create session ids without crypto, therefore we can't do retryable writes. In the Retryable Writes Spec our principle was to retry writes whenever possible, and silently ignore the retryWrites option when it's not possible, e.g. if the server is too old, or is a standalone, or if the write is a multi-update.

Should we obey that principle if there's no crypto lib also, or log a warning?

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