Skip to content

feature: host fallback support #184

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
merged 11 commits into from
Dec 10, 2021
Merged

feature: host fallback support #184

merged 11 commits into from
Dec 10, 2021

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented Dec 3, 2021

Closes #179

A (working) first-draft implementation for host fallback support.

Requires feedback

What's new:

  • BaseConnection.process_request()
    • Given a request, process it until a valid response is provided, or the max amount of tries has been reached.
    • host_index is still being chosen using the resolver's get_host_index method.
  • HostResolver.max_tries : int
    • A limit to the amount of attempts made to execute the request. Value varies based on the resolver type
  • HostResolver.host_count : int
    • The number of hosts provided
  • RandomHostResolver.get_host_index()
    • Reworked to keep track of previously chosen host indexes, to make sure that the next chosen host_index is not one of them.

@aMahanna aMahanna self-assigned this Dec 3, 2021
@aMahanna aMahanna requested a review from joowani December 5, 2021 05:17
Copy link
Contributor

@joowani joowani left a comment

Choose a reason for hiding this comment

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

Looks like a good start. I left some comments, some of which may not need to be addressed immediately if you are looking to do incremental changes.

Also, I'm not sure how much of this overlaps with active failover in ArangoDB (which python-arango does not have support for yet). I started a thread on it in the past but never got a chance to work on it. Hopefully that helps you in the future.

@aMahanna aMahanna requested a review from joowani December 5, 2021 21:29
@aMahanna aMahanna requested a review from joowani December 7, 2021 15:16
@aMahanna aMahanna changed the title do not merge: host fallback support draft feature: host fallback support Dec 9, 2021
Copy link
Contributor

@joowani joowani left a comment

Choose a reason for hiding this comment

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

Lgtm. Thanks for your contribution!

@aMahanna aMahanna merged commit 1900f4a into main Dec 10, 2021
@aMahanna aMahanna deleted the feature/host-fallback-support branch December 10, 2021 02:25
joowani pushed a commit that referenced this pull request Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Fallback hosts
2 participants