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

Integrate the failover client in ipfs-cluster-ctl #1222

Closed
hsanjuan opened this issue Aug 24, 2020 · 2 comments
Closed

Integrate the failover client in ipfs-cluster-ctl #1222

hsanjuan opened this issue Aug 24, 2020 · 2 comments
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked

Comments

@hsanjuan
Copy link
Collaborator

Describe the feature you are proposing

ipfs-cluster-ctl should use the restapi LBClient with a Failover strategy.

Particularly, it should also be possible to create a Failover and a RoundRobin client strategy from a /dnsaddr. If the record resolves to multiple multiaddresses, each client should be initialized to one of them.

This needs a method to turn a single Config into multiple ones that can be used for NewLBClient, each of them with one multiaddress as resolved from the /dnsaddr. i.e. config.AsTemplateFor([]multiaddresses) []Config and config.AsTemplateForResolvedAddresses(multiaddress) []Config.

This should in the end enable ipfs-cluster-ctl to perform auto-failover to other resolved addresses in a multiaddress.

@hsanjuan hsanjuan added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue exp/intermediate Prior experience is likely helpful status/ready Ready to be worked P1 High: Likely tackled by core team if no one steps up effort/hours Estimated to take one or several hours labels Aug 24, 2020
@omkarprabhu-98
Copy link
Contributor

So the input through the command line would be a list of client config attributes that would be converted to a list of configs and then be passed to create the LBClient?

@hsanjuan
Copy link
Collaborator Author

hsanjuan commented Oct 2, 2020

The input form the command line would be ipfs-cluster-ctl --host /dnsaddr/my.host ....

Initializing the LB/Failover clients requires passing each 1 configuration for each endpoint in it. Thus, we need helper methods to, given a template configuration, produce multiple configs only changing the client multiaddress. As mentioned above, an additional method can actually perform resolving:

AsTemplateForResolvedAddresses(address) -> resolves -> calls AsTemplateFor(resolved_addresses).

Once you have these two helper methods, it should be easy to update ipfs-cluster-ctl to use the Failover client.

hsanjuan added a commit that referenced this issue Oct 20, 2020
…ster-ctl

Feat #1222: Integrates the failover client in ipfs-cluster-ctl
@hsanjuan hsanjuan added this to the Release v0.13.1 milestone Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

2 participants