Skip to content
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

Added ability to access mongo oplog via a proxy #751

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added ability to access mongo oplog via a proxy #751

wants to merge 3 commits into from

Conversation

pratyus
Copy link

@pratyus pratyus commented Oct 18, 2017

Fixes #390

Added a new flag --is_oplog_proxy which tells the mongo connector to access oplog via the URI passed in. mongo_connector does not connect to individual shards directly to access mongo oplog.

mongo-connector -m <IP_ADDRESS>:<PORT> -a <USER> -p <PASS> --ssl-ca-certs=path/to/.pem -t <ELASTIC_DESTINATION> -d elastic2_doc_manager --is_oplog_proxy=True

@pratyus pratyus closed this Oct 18, 2017
@pratyus pratyus reopened this Oct 18, 2017
@pratyus pratyus changed the title Added ability to access mongo oplog via mongos router/proxy Added ability to access mongo oplog via a proxy Oct 19, 2017
believersconnect pushed a commit to believersconnect/mongo-connector that referenced this pull request Feb 7, 2018
Copy link

@Imran-imtiaz48 Imran-imtiaz48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review:
The code snippet demonstrates the configuration of MongoDB client options, including timezone awareness and proxy settings for oplog access. The tz_aware attribute is correctly initialized based on the provided keyword arguments, indicating whether timezone-aware functionality is required. Similarly, is_oplog_proxy is set to determine if the connection is via a MongoDB oplog proxy.
The add_option method is utilized to configure command-line interface (CLI) options for these settings. The help descriptions for is_oplog_proxy are clear and accurately describe its purpose for distinguishing between direct and proxied oplog access.
Recommendation:
To enhance clarity and maintain consistency, consider the following adjustments:

  1. Consistent Terminology: Ensure that terminology is consistent throughout the code and documentation. For example, the description for is_oplog_proxy should be aligned to avoid confusion (e.g., use "proxy with access to mongo oplog.rs" consistently).
  2. Documentation: Add comments or docstrings to the add_option function to explain its purpose and parameters. This will help other developers understand how to use and extend this function.
  3. Code Formatting: Verify that there are no unintended spaces or formatting issues. For instance, ensure that the indentation and alignment are consistent to improve readability.
  4. Error Handling: Consider implementing validation or error handling for the options being set. For example, check if tz_aware and is_oplog_proxy receive valid values and handle any potential exceptions that may arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants