The vtgate API takes a starting timestamp, or a starting EventToken. It
will only use the starting EventToken if it's relevant. This is mostly
for tests, but could be used by real clients too to avoid the timestamp
search on the servers.
The only restriction in the vtgate routing implementation is that a
query can only end up on one shard. The stream aggregation code inside
vtgate will be added later.
This change includes:
- proto changes.
- implementing the server side interface.
- implementing the client side interface.
- adding a vtctl VtTabletUpdateStream command to stream from a given
tablet. This is used in end-to-end tests.
- using the python vtgate_client update_stream API in all end-to-end
tests.
- removing the python vttablet direct stream_update API.
- vtgate now better preserves remote errors through its API now, as
withSuffix and withPrefix will preserve the error codes of all
VtError, not just *VitessError.
- Also adding callerid vtgateclienttest tests for all API calls.
- Adding an EventToken structure in query.proto.
- Using it in Binlog Streamer and filtered replication.
- Using it in Update Stream in POS events as well.
Note the main change there is that an EventToken has a replication
position (GTIDSet), not a transaction ID (GTID). Both server and clients
were computing the position individually anyway by accumulating
transaction IDs, might as well just send the position. And it will make
more sense for later use of EventToken.
Also, we don't set the 'Shard' field of the EventToken just yet. I'm
still not sure vttablet should do it, as opposed to vtgate.
In order to do that, I had to:
- Adding File/Dir APIs to topo.Backend.
- Implementing them for all flavors: memorytopo, zk, etcd, tee.
None of the backward compatible code is there yet,
so these can only be used for new objects.
- Adding corresponding unit tests.
- Fixing a few fake etcd-specific bugs.
Also now using CancelFunc for all topo watches.
The protobuf files are updated with the added
tabletmanagerservice.RestoreFromBackup and mysqlctl.ReinitConfig calls and their
respective Request/Response messages.
Changing Shard's db_name to db_name_override.
Rewording a bunch of comments in proto.
Factoring out tablet creation code in vtcombo.
Rebuilding keyspace graph for redirected keyspaces too,
and also setting ShardingColumn{Name,Type} for them.
This parameter is deprecated, so we should not expose it in the new
clients.
Also removing as_transaction from executeBatch*() methods in VTGateTx
since that parameter doesn't make sense when you're calling
executeBatch*() on a VTGateTx object. If you want as_transaction, you
should call executeBatch*() directly on VTGateConn.