[SERVER-23559] Primary Member selection is not appropriate - the node having less data becomes primary Created: 06/Apr/16  Updated: 15/Nov/21  Resolved: 31/May/16

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

Type: Bug Priority: Major - P3
Reporter: Aayushi Mangal Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Mentioned above

Participants:

 Description   

Hello Team,

I am not sure this comes in which category either in bug or improvement or something else.

Version: 3.0.4
Storage Engine: MMAPV1

I have a three-member replica set with 1 primary and 2 secondaries:

A - Primary
B - Secondary
C - Secondary
Initially I had only one Member A and all CRUD operations were performed on it only.

After some time I introduced 2 secondaries, B and C. Now again for some reason, secondaries were removed and rejoined in cluster.

Then I have stepdown node A to make node C primary.

Now it seems to be abnormal:

Node A:
rs1:SECONDARY> show dbs
TEST 2136.457GB

Node B:
rs1:PRIMARY> show dbs
TEST 351.329GB

Node C:
rs1:SECONDARY> show dbs
TEST 2136.457GB

-------------------------------

Node B becomes primary and now application is showing "No data found error"

B becomes primary after failover, I made Node A primary manually.
but is this any criteria to check syncronization first and then elect for the Primary Node . Please suggest



 Comments   
Comment by Aayushi Mangal [ 25/May/16 ]

Hello Fernandez,

The issue has been resolved, I have did this:

Stepdown the primary,
So I have new primary, then the previous primary became secondary.
And it was in sync now with the Primary.

The only concern I have earlier was how this situation happens so that we
will take care from next time.

Thank you for your response.
Regards:
Aayushi Mangal

On Tue, May 24, 2016 at 10:47 PM, Ramon Fernandez (JIRA) <jira@mongodb.org>

Comment by Ramon Fernandez Marina [ 24/May/16 ]

aayushi, please have a look at replSetGetStatus().

Please not that in order to investigate if there's a bug in MongoDB we need the logs that Thomas requested above. If you're interested in pursuing this issue please upload the complete logs for all replica set members.

Thanks,
Ramón.

Comment by Aayushi Mangal [ 06/Apr/16 ]

Thanks Thomas for the revert, would you please let me know how to check for recent optime for the replicaset member.
I can see optime as : "optime" : Timestamp(1459939986, 700)

Comment by Kelsey Schubert [ 06/Apr/16 ]

Hi aayushi,

A replica set member should not become primary unless it has the most recent optime of any visible member. To continue to investigate this issue, can you please upload the complete logs for each of the replica set members?

Thank you,
Thomas

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