Tikv: Verify range for Table / Index scan executor

Created on 17 Jun 2019  路  9Comments  路  Source: tikv/tikv

Feature Request

In coprocessor, we need to report errors when table ranges are sent to index scan executor, or index ranges are sent to table scan executor.

difficulteasy sicoprocessor statuhelp-wanted statumentor

All 9 comments

Hi, I am interested in working on this :slightly_smiling_face: I am really new to this project. Do you have any resources/pointers for me to get started on this?

@lpan Thanks for the interest! You need to add code to verify whether or not key meets the format (for index scan, it should be prefixed with tXXXXXXXX_iXXXXXXXX and for table scan it should be prefixed with tXXXXXXXX_rXXXXXXXX) in TableInnerExecutor::decode_row, IndexInnerExecutor::decode_row, BatchTableScanExecutor::process_kv_pair and BatchIndexScanExecutor::process_kv_pair.

@breeswish I think the easiest way is to check all ranges in builder.rs

@lonng

  • It cannot avoid invalid ranges like [tXXXXXXX1_r, tXXXXXXX2_r)
  • End key is not required to be in format tXXXXXXXX_r since we will only scan keys < end key.

@breeswish @lonng thanks so much everyone! I will dive into it soon. Will keep you posted if I run into any questions or blockers 馃檪

Hey everyone, I am planning to do one of the training courses before I start digging into TiKV. :slightly_smiling_face:

Anyone feels free to take over this issue while I am doing the course! Thanks!

Hi, I'm trying to fix this.
should we add a new type of error for wrong type of key range ? Maybe the meaning of StorageError and EvaluateError is not suitable.

@FateTHarlaown Hi, thanks for your interest. It can be an evaluation error since this error happens when evaluating the coprocessor request (invalid request, or more precise, invalid range).

Already finished.

Was this page helpful?
0 / 5 - 0 ratings