Skip to content

Commit 179fef1

Browse files
committed
Merge pull request alphagov#125 from alphagov/mongo-force-resync-one-at-a-time
Only force_resync on one mongo host at a time
2 parents 1c634bb + fe1785c commit 179fef1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mongo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def replsetlogs(*args):
4444

4545
@task
4646
def force_resync():
47-
"""Force a mongo secondary to resync by removing all it's data."""
47+
"""Force a mongo secondary to resync by removing all its data."""
48+
if len(env.hosts) > 1:
49+
abort("This task should only be run on one host at a time")
50+
4851
if i_am_primary():
4952
abort(colors.red("Refusing to force resync on primary", bold=True))
5053

0 commit comments

Comments
 (0)