[SERVER-8219] empty tag sets [{}] asserts with primary read preference Created: 17/Jan/13  Updated: 11/Jul/16  Resolved: 01/Feb/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File read_pref_cmd.js    
Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

In jsTests, with a ReplicaSetConnection:

conn.setReadPref("primary", [{}]);

... always results in:

Thu Jan 17 16:51:38.864 javascript execution failed src/mongo/shell/query.js:78 socket error on query
this._cursor = this._mongo.find( this._ns , this._query , this._fields , this.

[{}] should be treated the same as null, but apparently it's treated some other way.



 Comments   
Comment by auto [ 01/Feb/13 ]

Author:

{u'date': u'2013-01-24T16:07:18Z', u'email': u'randolph@10gen.com', u'name': u'Randolph Tan'}

Message: SERVER-8219 empty tag sets [{}] asserts with primary read preference
Branch: master
https://github.com/mongodb/mongo/commit/cd134b933098e6c777b49bd68365c644d8f63a16

Comment by Randolph Tan [ 23/Jan/13 ]

Did a quick survey:

Ruby: allowed
Python: allowed
Java: impossible
Php: allowed

So I am going to proceed to allow {} tag set for primary.

Comment by Randolph Tan [ 23/Jan/13 ]

The specs says that specifying tags for primary is an error. So, the C++ driver treats it as an error if read preference is primary and the tag field exists. Will check with how the other drivers deal with this to be consistent.

Comment by A. Jesse Jiryu Davis [ 17/Jan/13 ]

My local current version of read_pref_cmd.js

Generated at Thu Feb 08 03:16:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.