[CSHARP-959] Ignore WNote and JNote on pre-2.6 Servers. Created: 22/Apr/14  Updated: 02/Apr/15  Resolved: 24/Apr/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.9
Fix Version/s: 1.9.1

Type: Bug Priority: Major - P3
Reporter: Craig Wilson Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

We introduced new behavior into the driver to handle how 2.6 handles errors. However, this causes "warnings" to behave as errors in pre-2.6 servers. We need to revert this behavior when talking to pre-2.6 servers.

For example, when talking to a pre-2.6 server and performing a write that affects 0 documents while using a "w" field, the result is this:

WriteConcernException - WriteConcern detected an error 'no write has been done on this connection'. (Response was { "n" : 0, "lastOp" : { "$timestamp" : NumberLong(0) }, "connectionId" : 50820, "wnote" : "no write has been done on this connection", "err" : null, "ok" : 1.0 })

This causes an exception to be thrown, even though this is simply a warning.



 Comments   
Comment by Githook User [ 08/Sep/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: Revert "CSHARP-1057: Detect "jnote" errors reported by server 2.4.x."

See CSHARP-959.

This reverts commit 5c5aaa97d1f84d121a8ca0cba3521c5e1255abda.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/e7e012453346dceb076b1f0a3d69a5c6a5557643

Comment by Githook User [ 29/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-959: don't recognize wnote or jnote as errors.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/3c6cb9474b3a4c3457925ec58a88adb8bf228eb9

Comment by Githook User [ 29/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: Revert "CSHARP-959: wnote and jnote no longer throw errors on pre 2.6 servers."

This reverts commit 064bdfa47ecc4284260d17b89c92cff60426b79a.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/3a36e6c6f2a44f9c59d9167129caba52b9597f40

Comment by Githook User [ 29/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-959: don't recognize wnote or jnote as errors.
Branch: v1.x
https://github.com/mongodb/mongo-csharp-driver/commit/5dd99a883d594b449693fef5efd139b38e78dc4b

Comment by Githook User [ 29/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: Revert "CSHARP-959: wnote and jnote no longer throw errors on pre 2.6 servers."

This reverts commit 10cfbadd6bcee0cf5c7031a7baa5f118c7f59922.
Branch: v1.x
https://github.com/mongodb/mongo-csharp-driver/commit/82973743651282143d0d1560c6811473ccda6e93

Comment by Githook User [ 24/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-959: wnote and jnote no longer throw errors on pre 2.6 servers.

Conflicts:
src/MongoDB.Driver/Operations/BulkWriteResultConverter.cs
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/064bdfa47ecc4284260d17b89c92cff60426b79a

Comment by Githook User [ 24/Apr/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-959: wnote and jnote no longer throw errors on pre 2.6 servers.
Branch: v1.x
https://github.com/mongodb/mongo-csharp-driver/commit/10cfbadd6bcee0cf5c7031a7baa5f118c7f59922

Comment by Bernie Hackett [ 23/Apr/14 ]

It seems I've misunderstood this ticket. I was under the impression that jnote was only returned when j=true write concern was used with a server that had journaling disabled (--nojournal) or w > 1 was used with a standalone mongod instance.

It appears the server also returns wnote if the write concern wasn't applied because there was nothing to actually do (e.g. a remove operation have didn't match any documents so it didn't actually remove anything).

Comment by Bernie Hackett [ 23/Apr/14 ]

Any app that is seeing wnote or jnote is running against a totally misconfigured cluster, and will break either way when the cluster is upgraded to 2.6.

The example in the description seems to be the C# driver sending write operations with no actual documents? That seems like the driver is doing something wrong.

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