Is the communication between the coprocessor and tikv via tikv API? Does coprocessor used tikv-client only or called some internal method of tikv ?
There are two coprocessor APIs in TiKV. The first one (V1) is designed for TiDB, thus hardcoded TiDB’s knowledge; and the latter one (V2) is a redesigned coprocessor for general propose.
The V2 coprocessor has a plugin system that allows the user to write plugin in Rust, to build as a dynamic library, and to load on TiKV startup. But this feature is still in alpha testing. If you’re interested, we can invite you to join the test.
Thanks for your reply. I want to know whether the coprocessor uses TiKV like ticdc\br call tikv’s standard api?
No, they will use more lower layer APIs. V1 uses an interface similar to rocksdb snapshot and iterator. APIs used by V2 are defined in https://github.com/tikv/tikv/blob/master/components/coprocessor_plugin_api/src/storage_api.rs.