pingcap/tidb

The point get executor and batch point get executor may not be thread safe

Open

#19,130 opened on Aug 11, 2020

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Go (6,186 forks)batch import
challenge-programcomponent/executorhelp wantedsig/executiontype/question

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (Avg merge 14d 4h) (346 merged PRs in 30d)

Description

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

Issue https://github.com/pingcap/tidb/issues/16817 says

I guess there may exist other problems / panics behind this single symptom described in this issue, because PointGet now may be
 running in parallel with other goroutines(not only the main goroutine in this case, but other goroutines, e.g, workers of IndexJoin 
/ IndexHashJoin?), while the original implementation of its execution seems not to consider the possibility of concurrent running?
 We'd better do a full check of these potential concurrent situations to make sure PointGet is safe there.

For batchPointGetExecutor, the init flag is set using atomic operations, but the index field is not. Maybe we need to do more checks and tests to ensure these two executors are thread-safe.

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

SIG slack channel

#sig-exec

Score

300

Mentor

  • @lzmhhh123

Contributor guide