Skip to content

Getting hosts from vitess API#70

Merged
shlomi-noach merged 1 commit intomasterfrom
vitess-tablets
Sep 21, 2018
Merged

Getting hosts from vitess API#70
shlomi-noach merged 1 commit intomasterfrom
vitess-tablets

Conversation

@shlomi-noach
Copy link

This PR supports extracting list of hosts from Vitess's vtctld API.

It uses a api/ks_tablets endpoint, which is not (yet?) present in upstream. It supports specifying a shard, if desired, or it supports not specifying a shard, in which case all shards are considered.

@shlomi-noach shlomi-noach requested a review from a team September 16, 2018 06:45
@shlomi-noach shlomi-noach temporarily deployed to production September 16, 2018 07:16 Inactive
Timeout: 1 * time.Second,
}

func constructAPIURL(api string, keyspace string, shard string) (url string) {
Copy link
Contributor

@gtowey gtowey Sep 17, 2018

Choose a reason for hiding this comment

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

Are you connecting to consul and directly reading the data from there? That seems like it will miss tablets that are in different cells than the consul service you're attached to. It seems like this could break if vitess decides to change their data structure, and it won't work if someone decides to use another key storage system like etcd or zookeeper which are also supported by vitess.

I have an example of how to call the vitess client through gRPC here that may be helpful as an alternative: <redacted>

Copy link
Author

Choose a reason for hiding this comment

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

@gtowey freno does not read data from Consul here. It accesses a new vtctld Web API endpoint. That endpoint only exists in our internal Vitess code right now, but once tested for a few days it will be shared upstream, at which point I will drop a link in this public repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I wasn't aware vtctld had a web api -- I thought it was all through grpc. Well then, carry on =)

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.

3 participants