[SERVER-20084] the shell should not set slaveOk if a read preference is not set on the connection Created: 21/Aug/15  Updated: 19/Sep/15  Resolved: 25/Aug/15

Status: Closed
Project: Core Server
Component/s: JavaScript, Querying, Shell
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File patch.patch    
Issue Links:
Depends
is depended on by SERVER-19341 Finalize how read preference and slav... Closed
Related
related to SERVER-20147 fsm_all_sharded_replication.js - agg_... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform 8 08/28/15
Participants:

 Description   

This code assumes the read preference mode has been set, but in some cases it is uninitialized (undefined), in which case it is not equal to "primary", so the slaveOk option is set. If a read preference is not specified, it should default to "primary".

This seems to be the root cause of the linked build failure.

The attached patch helped diagnose the issue, and could be useful for debugging.



 Comments   
Comment by Githook User [ 25/Aug/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-20084 propogate overridden slaveOk setting though runReadCommand
Branch: master
https://github.com/mongodb/mongo/commit/efa95c72b047a3a92c13bba9562733b5d5e0f944

Comment by Githook User [ 25/Aug/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-20084 do not set slaveOk in runReadCommand if a read pref has not
been set
Branch: master
https://github.com/mongodb/mongo/commit/be9455abf3126d6136c9ce884a01a4a3e4389bc4

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