[CSHARP-547] Use of $csharpnull when serializing a BsonNull whose value is C# null halts replication (and in 2.2 the secondaries crash) Created: 23/Aug/12 Updated: 20/Mar/14 Resolved: 23/Aug/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.5 |
| Fix Version/s: | 1.6 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Description |
|
The C# driver uses { $csharpnull : true }to represent a BsonNull property whose value is C# null. For example:
results in:
The C# driver needs to use some other representation for BsonNull values of C# null because this representation either causes replication to halt (prior to server 2.2) or the secondaries to crash (in server 2.2 rc0 and rc1). This is also a server bug, in the sense that no value that a client driver provides should be allowed to halt replication or crash secondaries. If the server considers this representation to be invalid then it should have been rejected outright by the primary. |
| Comments |
| Comment by auto [ 24/Aug/12 ] |
|
Author: {u'date': u'2012-08-23T11:42:13-07:00', u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |
| Comment by Robert Stam [ 23/Aug/12 ] |
|
The proposed fix is to replace $csharpnull with _csharpnull (replacing the "$" with "_"). During deserialization either form will be accepted so that legacy documents can still be read. |
| Comment by Robert Stam [ 23/Aug/12 ] |
|
Linking to SERVER issue that suggests that the primary should have protected itself against a document it didn't consider valid instead of letting it replicate to the secondaries where it caused the secondaries to crash. |