Skip to content

provide better API client for debuggin MVCC info #1637

@tiancaiamao

Description

@tiancaiamao

Currently, the txn related API is easy to use:

txn := store.Begin()
txn.Get()
txn.Set()
txn.Scan()
....

snap := store.GetSnapshot()
snap.Get()
snap.Scan()
...

But the others are not easy to use.

The coprocessor API is implemented by the cop client:
https://github.com/pingcap/tidb/tree/master/pkg/store/copr

And the MVCC debug API is here:
https://github.com/pingcap/tidb/tree/master/pkg/store/helper

Both are in the tidb repo.

The coprocessor client API is defined here:
https://github.com/pingcap/tidb/blob/e98cf3d4cad24e8152574b4f201f943aab557d0d/pkg/kv/kv.go#L316-L318

Considering that sending coprocessor request require the DAG (which is done by the planner), it's hard to construct the DAG request manually, it's reasonable to leave coprocessor API to the tidb repo.

But I think we can move MVCC debug API here to client-go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions