MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / repl_set_step_down

Function repl_set_step_down

test/helpers.py:32–39  ·  view source on GitHub ↗

Run replSetStepDown, first unfreezing a secondary with replSetFreeze.

(client, **kwargs)

Source from the content-addressed store, hash-verified

30
31
32def repl_set_step_down(client, **kwargs):
33 """Run replSetStepDown, first unfreezing a secondary with replSetFreeze."""
34 cmd = SON([("replSetStepDown", 1)])
35 cmd.update(kwargs)
36
37 # Unfreeze a secondary to ensure a speedy election.
38 client.admin.command("replSetFreeze", 0, read_preference=ReadPreference.SECONDARY)
39 client.admin.command(cmd)
40
41
42class client_knobs:

Callers 1

Calls 3

updateMethod · 0.95
SONClass · 0.90
commandMethod · 0.45

Tested by 1