Conversation
| Timeout: 1 * time.Second, | ||
| } | ||
|
|
||
| func constructAPIURL(api string, keyspace string, shard string) (url string) { |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
Ah, I wasn't aware vtctld had a web api -- I thought it was all through grpc. Well then, carry on =)
This PR supports extracting list of hosts from Vitess's
vtctldAPI.It uses a
api/ks_tabletsendpoint, 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.