[SERVER-26211] secondaryCatchUpPeriodSecs of rs.stepDown() doesn't seem to work Created: 21/Sep/16  Updated: 08/Feb/23  Resolved: 23/Sep/16

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

Type: Bug Priority: Major - P3
Reporter: 아나 하리 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:

Just run below command. and compare the elapsed seconds to elect new primary.

rs.stepDown(100, 90)
rs.stepDown(100,5)

Participants:

 Description   

I've run rs.stepDown(long, int) command several times with different integer paramter.
But looks like period to elect new primary is nothing to do with secondaryCatchUpPeriodSecs and replSetStepDown parameters.

And one more thing is that primary/secondary swithing by changing member priority value doesn't waiting replication sync so this method make rollback but rs.stepDown is not.
Is there any difference between above two method ? (I can't find any difference of two method in manual.)



 Comments   
Comment by Kelsey Schubert [ 23/Sep/16 ]

Hi matt.lee,

Yes, that is correct. My recommendation would be to either only use priority values of 0 or 1 or to use replication protocol version 0 to avoid these small rollbacks until SERVER-23663 is released.

Kind regards,
Thomas

Comment by 아나 하리 [ 23/Sep/16 ]

Hi Thomas.

So we can't use priority takeover until SERVER-23663 released to avoid rollback.

> If what you are observing does not match this expectation, would you please upload the logs for each node in the replica set so we can continue to investigate?
I have found what I misunderstand, after reading source code and manual about secondaryCatchUpPeriodSecs and stepDown().

Thanks.

Comment by Kelsey Schubert [ 23/Sep/16 ]

Hi matt.lee,

Currently, as of MongoDB 3.2.9, using protocol version 1, priority takeovers do not include a catch-up period where the newly elected primary continues to sync for some time before accepting writes to avoid rollbacks. This feature is introduced in SERVER-23663 and will be included in MongoDB 3.4.

As you know, the secondaryCatchUpPeriodSecs is the maximum number of seconds that the primary will wait for a secondary to catch up, and an election will occur earlier when/if a secondary has caught up.

If what you are observing does not match this expectation, would you please upload the logs for each node in the replica set so we can continue to investigate?

Thank you,
Thomas

Comment by 아나 하리 [ 21/Sep/16 ]

Manual pages I've check are
> https://docs.mongodb.com/manual/tutorial/adjust-replica-set-member-priority/
> https://docs.mongodb.com/manual/reference/command/replSetStepDown/#dbcmd.replSetStepDown
> https://docs.mongodb.com/manual/reference/method/rs.stepDown/

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