[SERVER-5746] Wrong initialization for ReplicaSetMonitor Nodes Created: 02/May/12  Updated: 11/Jul/16  Resolved: 09/May/12

Status: Closed
Project: Core Server
Component/s: Internal Client, Sharding
Affects Version/s: 2.0.3
Fix Version/s: 2.0.6, 2.1.2

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 1
Labels: sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-5405 mongos does not send reads to seconda... Closed
Operating System: ALL
Participants:

 Description   

The nodes structure is initialized incorrectly in ReplicaSetMonitor that made them initialize to ok = false instead of ok = true. And because of SERVER-5405, the node can forever be marked as not ok. The side effect is that every time a connection needs to get the master, it will call isMaster & replsetGetStatus (in the normal case, will never get called because node is ok).

This also means that slaveOk will never work on a sharded environment with auth because the secondaries will be marked as bad nodes from the start and will never be able to recover from it (Without SERVER-5405's fix).



 Comments   
Comment by auto [ 11/May/12 ]

Author:

{u'login': u'', u'email': u'randolph@10gen.com', u'name': u'Randolph Tan'}

Message: SERVER-5746 Wrong initialization for ReplicaSetMonitor Nodes

Modified the initialization of the ok member variable of ReplicaSetMonitor::Node to true if conn smart pointer is not null.

Conflicts:

jstests/sharding/slaveok_routing.js
Branch: v2.0
https://github.com/mongodb/mongo/commit/db9d17af5cba0c432269f6e7bd02bac9af60438b

Comment by auto [ 09/May/12 ]

Author:

{u'login': u'', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: Updated test for SERVER-5746 to make buildbot pass
Branch: master
https://github.com/mongodb/mongo/commit/9e1d746c9c7865c5644ec623b63d4cc6e6249c74

Comment by auto [ 09/May/12 ]

Author:

{u'login': u'', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-5746 Wrong initialization for ReplicaSetMonitor Nodes

Modified the initialization of the ok member variable of ReplicaSetMonitor::Node to true if conn smart pointer is not null.
Branch: master
https://github.com/mongodb/mongo/commit/f799d9d40e4e14249a11cdf1e9fdb31a5bb09325

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