Skip to content

Commit 99d4e66

Browse files
committed
Add secondaryCatchUpPeriodSecs to replSetStepDown command.
secondaryCatchUpPeriodSecs is The number of seconds that the mongod will wait for an electable secondary to catch up to the primary. We put that time in 60 secs.
1 parent 2cfc6a3 commit 99d4e66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dbaas/drivers/mongodb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,10 @@ def data_dir(self, ):
496496
def switch_master(self, instance=None):
497497
client = self.get_client(None)
498498
try:
499-
client.admin.command('replSetStepDown', 10)
499+
client.admin.command(
500+
'replSetStepDown', 60,
501+
secondaryCatchUpPeriodSecs=60
502+
)
500503
except pymongo.errors.AutoReconnect:
501504
pass
502505

0 commit comments

Comments
 (0)