[SERVER-1681] replica set primaries should step down to SECONDARY rather than RECOVERING Created: 25/Aug/10  Updated: 12/Jul/16  Resolved: 14/Oct/10

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

Type: Improvement Priority: Minor - P4
Reporter: Dwight Merriman Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File rs_sync.diff    
Participants:

 Description   

currently the primary if it cannot see a majority will step down. however it steps down to recovering state not secondary. we can step down to secondary, at least for some period of time, and still be available for reads. or, do we not want to even allow reads in a minority partition? perhaps this is choosable in the config.



 Comments   
Comment by auto [ 14/Oct/10 ]

Author:

{'login': 'kchodorow', 'name': 'Kristina Chodorow', 'email': 'kristina@10gen.com'}

Message: master->secondary on stepdown SERVER-1681
http://github.com/mongodb/mongo/commit/de7e99dcf5bd825e6128164a33a7f75aacd42c2c

Comment by Kristina Chodorow (Inactive) [ 22/Sep/10 ]

> can you uncomment and see if all the tests in replsets/ pass?

Yes, they do. I added the connection killing lines, too, and everything still worked (once I added a few query retries and sleeps to the tests). I'll wait to commit until we talk.

Comment by Dwight Merriman [ 17/Sep/10 ]

kristina, see the commented out line near 'SERVER-1681' in db/repl/rs.cpp. can you uncomment and see if all the tests in replsets/ pass? note they might not just because of assumptions or timing. let's discuss more in person.

Comment by auto [ 17/Sep/10 ]

Author:

{'login': 'dwight', 'name': 'Dwight', 'email': 'dwight@10gen.com'}

Message: towards SERVER-1681
http://github.com/mongodb/mongo/commit/629f3a4c1c9c10ea0d5a1ce74d8b64b85e925f8b

Comment by Dwight Merriman [ 17/Sep/10 ]

Thanks. I worry that there may be edge cases – for example we don't want to transition to SECONDARY if we don't have an initial copy of the data yet, or if we are working on a rollback at the moment, or if we are in state FATAL.

This is in the queue for sure though, just want to be careful.

Comment by jerome bourgeois [ 10/Sep/10 ]

Hello,

This is a little patch generated from "mongodb-src-r1.6.2". This patch will assume when a server is alone in a replicaset, it becomes secondary.

Best regards.

Melkor

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