[SERVER-10945] isMaster can return duplicate hosts Created: 27/Sep/13  Updated: 11/Jul/16  Resolved: 24/Oct/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.5.2
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-10383 read_pref_cmd.js failed on Windows 64... Closed
Related
related to SERVER-10823 isMaster does not contain tags in som... Closed
Operating System: ALL
Steps To Reproduce:

Add a sleep in sharding/read_pref_cmd.js:

sleep(20000); // sleep long enough for                                                                                                                                                                                                                     
                                                                                                                                                                                                                                             
// Make sure replica set connection is ready                                                                                                                                                                                                 
_awaitRSHostViaRSMonitor(st.rs0.nodeList()[0], {ok: true}, "test-rs0");                                                                                                                                                                      
_awaitRSHostViaRSMonitor(st.rs0.nodeList()[1], {ok: true}, "test-rs0");   

If you set mongos or shell to verbose, you can see the isMaster response in the logs by searching "ReplicaSetMonitor::_checkConnection"

Participants:

 Description   

Sample bad response:

{
setName: "test-rs0",
setVersion: 2,
ismaster: true,
secondary: false,
hosts: [
  "Randolphs-MacBook-Air.local:31100",
  "Randolphs-MacBook-Air.local:31101",
  "Randolphs-MacBook-Air.local:31101"
],
primary: "Randolphs-MacBook-Air.local:31100",
tags: { dc: "ny", tag: "one" },
me: "Randolphs-MacBook-Air.local:31100",
maxBsonObjectSize: 16777216,
maxMessageSizeBytes: 48000000,
localTime: new Date(1380305413050),
maxWireVersion: 1,
minWireVersion: 0,
ok: 1.0
}                                                                                                                              

The impact in mongos is that this would cause an assertion failure (and print a stacktrace) and make the nodes unusable (can't perform queries, insert, etc).



 Comments   
Comment by auto [ 24/Oct/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-10945 don't end up with double entries in _members after a reconfig
Branch: master
https://github.com/mongodb/mongo/commit/c3019ad939da94e44689c49a92a86b357b8c2596

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