Skip to content

Support TiKV API V2 #555

@pingyu

Description

@pingyu

Feature Request

Describe the feature you'd like:

Support TiKV API V2, to obtain more TiKV features such as "cross cluster replication", mixed using TiDB + TxnKV + RawKV on the same TiKV cluster, etc.
See API V2 proposal and its implementation details for detail.
Refer to tikv/tikv#10938.

Teachability, Documentation, Adoption, Migration Strategy:

Some developing features (including "Cross Cluster Replication", mixed using TiDB + TxnKV + RawKV) of TiKV depends on API V2.
We also recommend that users switch to API V2 ASAP, as most features in the future will also be based on API V2.
Data migration is required, as underlying data encoding between API V2 and the early version is quite different. Tools for migration will be provided in the near future.

Modification Required:

  1. Set api_version = 2 in kvrpcpb.Context.
  2. Prefix requesting keys by r for RawKV, and x for TxnKV.
  3. Request region info from PD with keys having r/x prefix and Mem-comparable Padding.
  4. Remove prefix of keys from the response if any (e.g. raw_scan, scan).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions