Wrong error message when readPreference tags are invalid

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.5.4
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If I pass an array of tag sets that includes null, mongos properly detects that the tag set isn't a BSON object, but raises the wrong error anyway:

      mongos> db.sharded_collection.findOne({$query:{shard_key: 500}, $readPreference: {mode: 'secondary', tags:[{'field': 'whatever'}, null]}})
      Thu Oct 17 11:21:13.112 JavaScript execution failed: error: { "$err" : "Failed to call say, no good nodes in replset_1", "code" : 16380 } at src/mongo/shell/query.js:L128
      

      In the log:

      Thu Oct 17 11:21:13.112 [conn5] User Assertion: 16357:Tags should be a BSON object
      Thu Oct 17 11:21:13.112 [conn5] can't callLazy replica set slave :27017:  :: caused by :: 16357 Tags should be a BSON object
      Thu Oct 17 11:21:13.112 [conn5] _check : replset_1/localhost:5000,localhost:5001,localhost:5002
      Thu Oct 17 11:21:13.112 [conn5] User Assertion: 16380:Failed to call say, no good nodes in replset_1
      

      The user should see the "Tags should be a BSON object" error, not "Failed to call say, no good nodes".

            Assignee:
            Randolph Tan
            Reporter:
            A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: