[SERVER-11971] slaveok versioning logic in mongos should also apply to read prefs Created: 05/Dec/13  Updated: 11/Jul/16  Resolved: 20/Dec/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.4.8
Fix Version/s: 2.4.9, 2.5.5

Type: Bug Priority: Major - P3
Reporter: Greg Studer Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12041 retry logic for read preferences shou... Closed
Operating System: ALL
Participants:

 Description   
Issue Status as of January 8th, 2014

ISSUE SUMMARY
Mongos does not treat non-primary only read preferences the same as slaveOk.

This issue is part of 4 related issues which impact cluster availability when there is no primary available for a shard. See SERVER-7246, SERVER-5625, SERVER-11971 and SERVER-12041 for more details.

USER IMPACT
Non-primary read preferences (without slaveOk set) are not tolerant of the primary being down after splits or migrations have occurred. This will cause existing connections to fail in the event that the primary is unavailable.
It is present in versions of MongoDB prior to and including v2.4.8.

SOLUTION
Treat non-primary only read preferences the same as if slaveOk is set.

WORKAROUNDS
Set the slaveOk bit as well as the non-primary only read preference in the client application.

PATCHES
Production release v2.4.9 contains the fix for this issue, and production release v2.6.0 will contain the fix as well.

Original Description

When running a slaveok query on mongos which (potentially) talks to secondary nodes, we attempt to set the shard version on the connection but tolerate failure. The slaveok flag is not necessarily set when read preferences are used, but the same logic should apply.

Not a regression, but needs improvement.



 Comments   
Comment by Githook User [ 11/Dec/13 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-11971 slaveok versioning logic should also apply to read prefs
Branch: master
https://github.com/mongodb/mongo/commit/71143283f58bea945bd41a5d62f2a3a95a3191af

Comment by Githook User [ 07/Dec/13 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-11971 slaveok versioning logic should also apply to read prefs
Branch: v2.4
https://github.com/mongodb/mongo/commit/9a1b20453b318801c344850879023427c812c047

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