-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable KV Timeout Tracking Issue #45380
Comments
i could first work on |
@cfzjywxk can you create a dev branch for it where we can collaborate? |
@Tema |
@cfzjywxk could you please take a look at tikv/client-go#917. This will help us to work independently on |
* kv request: configurable KV Timeout (#45601) close #45380 * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * refine code Signed-off-by: crazycs520 <crazycs520@gmail.com> * make bazel_prepare Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> --------- Signed-off-by: crazycs520 <crazycs520@gmail.com> Co-authored-by: Chen Ding <dingc05@gmail.com>
* kv request: configurable KV Timeout (#45601) close #45380 * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * refine code Signed-off-by: crazycs520 <crazycs520@gmail.com> * make bazel_prepare Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> --------- Signed-off-by: crazycs520 <crazycs520@gmail.com> Co-authored-by: Chen Ding <dingc05@gmail.com>
* kv request: configurable KV Timeout (#45601) close #45380 * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * refine code Signed-off-by: crazycs520 <crazycs520@gmail.com> * make bazel_prepare Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> * update go.mod Signed-off-by: crazycs520 <crazycs520@gmail.com> --------- Signed-off-by: crazycs520 <crazycs520@gmail.com> Co-authored-by: Chen Ding <dingc05@gmail.com>
Background
Tasks
TiDB
tidb_kv_read_timeout
. kv request: configurable KV Timeout #45601tidb_kv_read_timeout
. When parsing and processing user hints in theExtractTableHintsFromStmtNode
andhandleStmtHints
functions, convert the input hint value into the corresponding field ofStmtContext
so it can be used later. kv request: configurable KV Timeout #45601KVReadTimeout
field in theStatementContext
, it could be set from the session variable or the hint value. kv request: configurable KV Timeout #45601pointGetExecutor
andbatchPointGetExecutor
, setting the timeout value to the underlyingKVSnapshot
which is used by the executors.kv request: configurable KV Timeout #45601copTask
, setting the timeout value to theContext.max_execution_duration_ms
field when building coprocessor kv-reuqests. kv request: configurable KV Timeout #45601KV-Client
SetKVReadTimeout
and get interfaceGetKVReadTimeout
forKVSnapshot
. So the executors in TiDB could use them to get or set timeout values. Setting thetidb_kv_read_timeout
in theContext.max_execution_duration_ms
whenget
anbatchGet
are used. use tidb_kv_read_timeout as first kv request timeout tikv/client-go#919tidb_kv_read_timeout
. When a timeout happens, retry the next available peer for the read requests like stale read and non-leader-only snapshot read requests. The strategy is:ConfigurableReadTimeoutErr
. It should not be mixed with the existingRPCError
. use tidb_kv_read_timeout as first kv request timeout tikv/client-go#919ReadShortTimeout
andReadMediumTimeout
values. Continue to process like before. use tidb_kv_read_timeout as first kv request timeout tikv/client-go#919KVSnapshot
andClientHelper
.TiKV
requests are received, the
kv_read_timeout
value should be read from theGetReuqest
andBatchGetRequest
requests and passed to the
pointGetter
. By now there's no canceling mechanism when the task is scheduled to theread pool in TiKV, a simpler way is to check the deadline duration before the next processing and try to return
directly if the deadline is exceeded, but once the reading task is spawned to the read pool it could not be
canceled anymore. storage: add deadline check in get and batch_get request handler tikv/tikv#15307
Support Timeout Configuration For Coprocessor Tasks. Use thekv_read_timeout
value passed in to calculate thedeadline
result inparse_and_handle_unary_request
instead of using the default one.The text was updated successfully, but these errors were encountered: