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

Duplicate bson field error message refers to something which is not user input

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Won't Do
    • 4.4.0-rc11
    • None
    • None
    • ALL
    • Hide

      Send multiple $readPreference fields in a find query.

      Show
      Send multiple $readPreference fields in a find query.

    Description

      We currently have an issue in the Ruby driver where the driver appears to always add its own $readPreference field to the query, even if the user already specified a read preference. This appears to manifest itself as two $readPreference fields being sent to the server.

      The error message that the server produces in this case references "OperationSessionInfo" which as far as I can tell is not something that the driver sent to it.

      irb(main):002:0> c.database.command(find: "foo", '$readPreference': {})
       
      localhost:14420 #1:1 | admin.find | STARTED | {"find"=>"foo", "$readPreference"=>{"mode"=>"primary"}, "$db"=>"admin", "lsid"=>{"id"=><BSON::Binary:0x1020 type=uuid data=0x6e42f7d4fd24479a...>}}
       
      D, [2020-07-08T14:22:45.203680 #7382] DEBUG -- : MONGODB | [10] localhost:14420 | admin.find | FAILED | BSON field  'OperationSessionInfo.$readPreference' is a duplicate field (40413) | 0.000546408s
      
      

      I expected the server error messages to only refer to fields that were provided to it as input and not to internal data structures.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-servicearch Backlog - Service Architecture
              oleg.pudeyev@mongodb.com Oleg Pudeyev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: