Support KeySpace
KeySpace is fundamental for transaction safety and multi-tenant features for TiKV. This is the tracking issue for the feature in client-go. For tracking issues of other components, check:
- TiKV: https://github.com/tikv/tikv/issues/12999
- PD: https://github.com/tikv/pd/issues/5293
Currently, we only implemented the feature that writes data to the default keyspace in raw.Client leading to three major issues:
- [x]
txn.Clientis still in API V1. The transaction requests are not encoded: https://github.com/tikv/client-go/pull/557. @AmoebaProtozoa - [x] Only default keyspace could be written. We should provide some API to write specified keyspace with their name or ID. @AmoebaProtozoa
- [x] If TiDB need writes different keyspaces, the coprocessor request should be encoded on the client side. Meanwhile, the TiKV coprocessor should decode the key before doing calculations. @iosmanthus
There are some bugs with the KeySpace feature in client-go, we track them here:
- [x] https://github.com/tikv/client-go/issues/544 @iosmanthus
Please also request downstream tools (such as TiKV-BR & TiKV-CDC) to support KeySpace. Otherwise they will be abnormal on processing data with non-default KeySpace.
Will you update this https://github.com/pingcap/tidb/blob/master/store/driver/tikv_driver.go#L120 any soon? The client-go PR is blocking TiDB to have any further client-go changes, I think etcdAddrs, disableGC, _, err : = config.ParsePath can make it pass, but I am not sure whether this is the right way to go. @AmoebaProtozoa