Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe1785c

Browse files
committed
Only force_resync on one mongo host at a time
Running this task on all 3 machines in a MongoDB cluster will causeall MongoDB data to be removed.
1 parent1c634bb commitfe1785c

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
defforce_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+
iflen(env.hosts)>1:
49+
abort("This task should only be run on one host at a time")
50+
4851
ifi_am_primary():
4952
abort(colors.red("Refusing to force resync on primary",bold=True))
5053

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp