[CSHARP-513] MongoDatabaseTests.TestGetProfilingInfo fails with InvalidOperationException when run against 2.1.2 Created: 29/Jun/12  Updated: 20/Mar/14  Resolved: 22/Jul/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4.2
Fix Version/s: 1.6

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

Latest sources against mongodb 2.1.2. The same test succeeds against 2.0.6



 Description   

MongoDB.DriverUnitTests.MongoDatabaseTests.TestGetProfilingInfo:
System.InvalidOperationException : ReadBsonType can only be called when State is Type, not when State is Value.

The stack trace is

at MongoDB.Bson.IO.BsonReader.ThrowInvalidState(String methodName, BsonReaderState[] validStates) in C:\source\mongo-csharp-driver\Bson\IO\BsonReader.cs:line 745
at MongoDB.Bson.IO.BsonBinaryReader.ReadBsonType[TValue](BsonTrie`1 bsonTrie, Boolean& found, TValue& value) in C:\source\mongo-csharp-driver\Bson\IO\BsonBinaryReader.cs:line 181
at MongoDB.Bson.IO.BsonReader.ReadBsonType() in C:\source\mongo-csharp-driver\Bson\IO\BsonReader.cs:line 375
at MongoDB.Driver.SystemProfileInfoSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options) in C:\source\mongo-csharp-driver\Driver\Core\SystemProfileInfo.cs:line 382
at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options) in C:\source\mongo-csharp-driver\Bson\Serialization\Serializers\BsonBaseSerializer.cs:line 77
at MongoDB.Bson.Serialization.BsonSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options) in C:\source\mongo-csharp-driver\Bson\Serialization\BsonSerializer.cs:line 230
at MongoDB.Driver.Internal.MongoReplyMessage`1.ReadFrom(BsonBuffer buffer, IBsonSerializationOptions serializationOptions) in C:\source\mongo-csharp-driver\Driver\Internal\MongoReplyMessage.cs:line 105
at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializationOptions serializationOptions) in C:\source\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 445
at MongoDB.Driver.MongoCursorEnumerator`1.GetReply(MongoConnection connection, MongoRequestMessage message) in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 296
at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 253
at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 141
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at MongoDB.DriverUnitTests.MongoDatabaseTests.TestGetProfilingInfo() in C:\source\mongo-csharp-driver\DriverUnitTests\Core\MongoDatabaseTests.cs:line 181



 Comments   
Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-21T13:29:01-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-513: Added missing doc comments and edited a few others. Changed implementation of DeserializeValue. Renamed Raw to RawDocument (to match other similar classes) and a few other private variable renamings.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/30cb88705e5ef4d35c1d7aa2080f0a75a9d7f334

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-21T09:37:41-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: cleanup and renaming.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/516525777b81ebb6cbf69ab3e5d36370fdb8c771

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-21T06:06:00-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: moved duplicate code from BsonSerializationInfoHelper to BsonSerializationInfo.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/c6d50dd6efa505e9c8b8b71d65a16e3149e474bd

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-21T05:58:00-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: further enhancements to the BsonDocumentBackedClass.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/9e5ba7dd9d3954c5b4345a0fc9611386c86da76e

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-20T19:11:47-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: added BsonDocumentBackedClass to remove the redundancy of element name specifications between a serializer and a backed document.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/df7cb45c3f02f78afc381a16a11c94a95f9def47

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-20T18:42:36-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: refactored SystemProfileInfo to be backed by a document.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/0bbb7977928c98bf3a3798ed92163e3e8961f62c

Comment by auto [ 21/Jul/12 ]

Author:

{u'date': u'2012-07-20T11:51:55-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}

Message: CSHARP-513: added new server values into SystemProfileInfo.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/3fff8c4de77fcf1caa4df857f0b60733b5384cea

Comment by Robert Stam [ 01/Jul/12 ]

I pushed the missing SkipValue to master. So in version 1.5 the new fields added by server 2.2 are ignored. We are postponing to 1.6 adding support for the new fields.

Comment by auto [ 01/Jul/12 ]

Author:

{u'date': u'2012-06-30T20:48:02-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-513: Fixed SystemProfileInfo.Deserialize to call SkipValue on unknown fields. In 1.6 we will add support for the new fields.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/43103bb76660a8b9599714297e341c6356d21cc4

Comment by Sridhar Nanjundeswaran [ 29/Jun/12 ]

Note : This works fine with 2.1.1 also

Comment by Sridhar Nanjundeswaran [ 29/Jun/12 ]

The 2.0.6 profile entry is
{
"ts": ISODate("2012-06-29T21:32:23.079Z"),
"op": "command",
"ns": "test2.$cmd",
"command":

{ "profile": 0 }

,
"ntoreturn": 1,
"responseLength": 58,
"millis": 0,
"client": "127.0.0.1",
"user": ""
}

The 2.1.2 profile entry is
{
"ts": ISODate("2012-06-29T21:32:19.933Z"),
"op": "command",
"ns": "test2.$cmd",
"command":

{ "profile": 0 }

,
"ntoreturn": 1,
"keyUpdates": 0,
"numYield": 0,
"lockStatMillis": {
"timeLocked":

{ "r": NumberLong(0), "w": NumberLong(334952) }

,
"timeAcquiring":

{ "r": NumberLong(0), "w": NumberLong(21) }

},
"responseLength": 58,
"millis": 0,
"client": "127.0.0.1",
"user": ""
}

MongoDB.Driver.SystemProfileInfoSerializer does not account for numYield and lockStateMillis

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