difficulty/hardhelp wantedsig/coprocessor
描述
Description
Currently TiDB always sends all schema TiKV needs in each Coprocessor request. The cost of dealing with the schema may take notable proportion for short OLTP requests.
Considering that DDLs are very few, table schemas are very likely to be unchanged for most of the requests, caching the schema at TiKV side may be helpful for these OLTP requests.
Proposal:
- TiDB only sends TableId, TableSchemaUpdateTs, ColumnIds to TiKV in each request.
- TiKV checks whether local cached schema is still valid according to TableId and TableSchemaUpdateTs.
- If local cached schema is not valid, TiKV returns a SchemaOutdatedError, indicating that TiDB need to re-send full schema to TiKV.
- If local cached schema is valid, TiKV uses this schema with supplied ColumnIds to process the request.
- TiDB resends the Request carried with full schema to TiKV if the previous request failed with SchemaOutdatedError.
Note: this PCP is still a proposal, which needs some discussion to check details. Remember to sync with mentor if you are interested in this PCP.
Difficulty
- Hard
Score
- 4200
Mentor(s)
- @breeswish
- @lonng
Recommended Skills
- Rust and Golang programming