[CSHARP-2129] Insert with RetryWrites=true should work on standalone Created: 18/Dec/17 Updated: 28/Oct/23 Resolved: 26/Dec/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Configuration, Write Operations |
| Affects Version/s: | 2.5 |
| Fix Version/s: | 2.5.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Steffen Schaffert | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2012 R2 64-bit, MongoDB 3.6, .NET 4.5 |
||
| Issue Links: |
|
||||||||
| Description |
|
I just updated our development MongoDB instance to MongoDB 3.6 using the C# Driver 2.5. When setting the new option "RetryWrites" in MongoClientSettings to true, I get the error message listed below when trying to insert a new document. The feature compatibility version is set to 3.6, although this should probably work with older MongoDB versions as well. The database is running on the same server as the code using the C# driver, the database is configured as a standalone instance. Setting the option "RetryWrites" to false allows the write operation to succeed, so this issue seems to be caused by enabling retries. I would expect this option to work for standalone installations as well as for replica set installations.
|
| Comments |
| Comment by Githook User [ 16/Mar/18 ] |
|
Author: {'email': 'robert@robertstam.org', 'name': 'rstam', 'username': 'rstam'}Message: |
| Comment by Githook User [ 16/Mar/18 ] |
|
Author: {'email': 'robert@robertstam.org', 'name': 'rstam', 'username': 'rstam'}Message: |
| Comment by Githook User [ 26/Dec/17 ] |
|
Author: {'username': 'rstam', 'name': 'rstam', 'email': 'robert@robertstam.org'}Message: |
| Comment by Githook User [ 26/Dec/17 ] |
|
Author: {'username': 'rstam', 'name': 'rstam', 'email': 'robert@robertstam.org'}Message: |
| Comment by Robert Stam [ 21/Dec/17 ] |
|
A standalone server does not support retryable writes. Only replica sets and sharded clusters support retryable writes. However, the driver should know this and should not be sending a transaction number when connected to a standalone server. A workaround until this is fixed is to not set RetryWrites to true. Thank you for reporting this. |