Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27317

Inserting a document with a Decimal128 value when featureCompatibilityVersion is 3.2 results in a closed socket

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.9
    • Component/s: Write Ops
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      In C#:

      var document = new BsonDocument { { "_id", 1 }, { "x", new BsonDecimal128(1.1M) } };
      collection.InsertOne(document);
      

      Show
      In C#: var document = new BsonDocument { { "_id", 1 }, { "x", new BsonDecimal128(1.1M) } }; collection.InsertOne(document);
    • Sprint:
      Platforms 2017-09-11
    • Case:

      Description

      When using the C# driver (and presumably other drivers) inserting a document that contains a Decimal128 value when featureCompatibilityVersion is 3.2 results in the socket being closed.

      The following appears in the server logs:

      2016-12-07T11:52:20.797-0500 I -        [conn2] AssertionException handling request, closing client connection: 22 Client Error: bad object in message: Cannot use decimal BSON type when the featureCompatibilityVersion is 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.
      2016-12-07T11:52:20.797-0500 I -        [conn2] end connection 127.0.0.1:53744 (3 connections now open)
      

      I am unable to reproduce this is in the shell, so perhaps this is a result of different code paths in the server (the shell uses OP_COMMAND and drivers do not).

      In the shell I just get a write error but the socket is not closed.

      > db.test.insert({ _id : 1, x : NumberDecimal("1.1") })
      WriteResult({
              "writeError" : {
                      "code" : 22,
                      "errmsg" : "Cannot use decimal BSON type when the featureCompatibilityVersion is 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility."
              }
      })
      >
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: