client-go icon indicating copy to clipboard operation
client-go copied to clipboard

Support KeySpace

Open iosmanthus opened this issue 3 years ago • 1 comments

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.Client is 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

iosmanthus avatar Jul 14 '22 06:07 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.

pingyu avatar Aug 25 '22 08:08 pingyu

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

v01dstar avatar Jan 10 '23 09:01 v01dstar