[SERVER-14149] isMaster may report an incorrect master Created: 03/Jun/14  Updated: 10/Dec/14  Resolved: 25/Nov/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.7.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Davide Italiano Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux localhost.localdomain 3.14.4-200.fc20.x86_64 #1 SMP Tue May 13 13:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


Issue Links:
Related
Operating System: ALL
Participants:

 Description   

A replica may report itself as primary (via isMaster), but when stepDown is issued the command execution fails with "not primary can't step down".

https://github.com/dcci/mongo-replication-perf/blob/master/stepDown.py
can be used to reproduce.

Output:

localhost:30002 5.686825037
[...]
localhost:30001 5.59844589233
localhost:30002 5.70268511772
command SON([('replSetStepDown', 30)]) failed: not primary so can't step down
{u'hosts': [u'localhost:30002', u'localhost:30003', u'localhost:30001'],
 u'ismaster': False,
 u'localTime': datetime.datetime(2014, 6, 2, 22, 52, 13, 153000),
 u'maxBsonObjectSize': 16777216,
 u'maxMessageSizeBytes': 48000000,
 u'maxWireVersion': 2,
 u'maxWriteBatchSize': 1000,
 u'me': u'localhost:30002',
 u'minWireVersion': 0,
 u'ok': 1.0,
 u'primary': u'localhost:30003',
 u'secondary': True,
 u'setName': u'rs0',
 u'setVersion': 1}

I bisected the tree to find the commit that caused the problem and we've a culprit:

commit c27f26b7b49714649800a7d602fead7d57ca3805
Author: matt dannenberg <matt.dannenberg@10gen.com>
Date:   Fri May 23 05:23:13 2014 -0400
 
    SERVER-14042 decrease yea delay from 30 seconds to 3



 Comments   
Comment by Andy Schwerin [ 25/Nov/14 ]

The root cause change (reducing yea time to 3 seconds) was reverted, and I believe this is no longer reproducible.

Comment by Eric Milkie [ 13/Jun/14 ]

Matt did some preliminary debugging of this.

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