-
Notifications
You must be signed in to change notification settings - Fork 81
Allow specifying preferred replica set members #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
timvaillancourt
merged 15 commits into
Percona-Lab:master
from
CenterDevice:preferred-members
Dec 7, 2018
Merged
Allow specifying preferred replica set members #291
timvaillancourt
merged 15 commits into
Percona-Lab:master
from
CenterDevice:preferred-members
Dec 7, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There already was a switch in place for the Python executable, but both the readlink and cp commands use flags not present on the default macOS binaries. This commit adds a check upfront and aborts with a message about you needing the coreutils package from homebrew to get the GNU variants of both commands.
Allows specifying a custom location of the "tar" command to use. Also, the flags sent to "tar" are sent individually (`tar -cf` becomes `tar -c -f`). This allows easily customizing how the archiving is performed without having to add lots of new options. For example, you could encrypt backup data via a simple shell script and specify it for --archive.tar.binary: ``` #!/bin/bash gpg_pubkey_id=XXXXXXX new_args="" while [ "${#}" -gt 0 ]; do case "$1" in -f) shift; original_output_file="${1}" shift new_args="${new_args} --to-stdout" ;; *) new_args="${new_args} ${1}" shift ;; esac done tar ${new_args} | gpg --always-trust --encrypt --recipient ${gpg_pubkey_id} -z 0 --output ${original_output_file} ``` This has several advantages: * Backups are never written to disk unencrypted * Encryption can be done in one go, instead of causing the potentially heavy additional I/O a separate encryption step would incur. * It's transparent for the upload stages, so you can still benefit from the integrated S3 (or other) uploads.
The S3 uploader fails if bucket permissions are restricted to only allow accessing certain prefixes in a bucket. The default behavior for boto's "get_bucket()" is to "validate" it by accessing the bucket's root, needlessly breaking the uploader even though all necessary permissions might be present. This patch adds a new command line switch --upload.s3.skip_bucket_validation to disable this behavior.
Allows influencing the selection of secondaries by custom criteria not expressible with the existing priorities or tags. Example: mongodb-consistent-backup ... --replication.preferred_members=rs01/mongod-01:27017 ... If the list of discovered secondaries for replica set rs01 contains the member server 'mongod-01:27017' its score will be raised to a very high level. Unless its replication lag exceeds the allowed limit, it will be picked to get the dump from, even if there were potentially other candidates.
Mistakenly removed the import on the wrong branch.
timvaillancourt
suggested changes
Dec 6, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, can you please add this new flag to the example config? Looks good otherwise.
timvaillancourt
approved these changes
Dec 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes it is helpful to specify one or more preferred
replica set secondaries explicitly, for example when
you for some reason cannot or don't want to tag instances,
but still have a clear preference from which servers you
want your backup to read.
This patch adds a new --replication.preferred_members
parameter that expects one or more replica set members
in the form
replset-name/host:port
. If a host matcheson of the names specified (separated by commas), they
get their score bumped to ensure they are the chosen
backup source.
Again: Please excuse the messy history. GitHub has broken
clean PR workflows.