-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Slice bounds out of range after inserting many rows in a transaction #57425
Comments
The backtrace:
|
Direct bisect gives me #56203. However, I don't think they have any connections 🤔 . |
Oops. This issue is not related to the foreign key. I'll modify the description. |
It can be reproduced by func TestTxnInsertIndex(t *testing.T) {
store := realtikvtest.CreateMockStoreAndSetup(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table t1 (id int auto_increment key, b int, index(b));")
for i := 0; i < 20; i++ {
tk.MustExec("begin")
tk.MustExec("insert into t1 (b) values (1),(2),(3),(4),(5),(6),(7),(8);")
for j := 0; j < 8; j++ {
tk.MustExec("insert into t1 (b) select /*+ use_index(t1, b) */ id from t1;")
}
}
} |
/cc @cfzjywxk |
@YangKeao Is it verified to be reproducable on old versions like 7.1 and 7.5? |
No. My mistake. It's not reproducible in 7.1, 7.5 and 8.1. |
Related to the new memdb, @you06 PTAL |
Yes, the test can pass when I switch back to red-black tree memdb. It's related to the iterator. |
This may be caused by reading from iterator and writing the membuffer concurrently. When the iterator runs halfway, writing to the membuffer changes the structure of the tree. The RBT will not return keys out of the given range in this situation, but ART will. |
ref pingcap/tidb#57425 Signed-off-by: you06 <you1474600@gmail.com>
…#1503) ref pingcap/tidb#57425 Signed-off-by: you06 <you1474600@gmail.com>
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Insert successfully.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
4fded5f
The text was updated successfully, but these errors were encountered: