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

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 4.4.0-rc11
    • Component/s: None
    • Service Arch
    • ALL
    • Hide

      Send multiple $readPreference fields in a find query.

      Show
      Send multiple $readPreference fields in a find query.

      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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: