pingcap / pingcap/tidb

unistore got wrong result for MPP table scan of partition table

Open
#49,763 0 comments 0 reactions 0 assignees View on GitHub
affects-8.1 affects-8.5 may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 severity/major sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
1. write following go test
```
func TestMPPRecovery(t *testing.T) {
store := testkit.CreateMockStore(t, withMockTiFlash(2))
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")

tk.MustExec("create table t(a int not null primary key, b int not null) partition by hash(a) partitions 2")
tk.MustExec("alter table t set tiflash replica 1")
tb := external.GetTableByName(t, tk, "test", "t")
err := domain.GetDomain(tk.Session()).DDL().UpdateTableReplicaInfo(tk.Session(), tb.Meta().ID, true)
require.NoError(t, err)

checkStrs := []string{"0 0"}
insertStr := "insert into t values(0, 0)"
for i := 1; i < 1500; i++ {
insertStr += fmt.Sprintf(",(%d, %d)", i, i)
checkStrs = append(checkStrs, fmt.Sprintf("%d %d", i, i))
}
tk.MustExec(insertStr)

tk.MustExec("set @@session.tidb_isolation_read_engines=\"tiflash\"")

sql := "select * from t order by 1, 2"

tk.MustExec("set @@tidb_max_chunk_size = default")
tk.MustQuery(sql).Check(testkit.Rows(checkStrs...))
}
```
2. run multiple times: `go test . -v --tags=intest -run TestMPPRecovery --count=100 > t`

### 2. What did you expect to see? (Required)
case succeed
### 3. What did you see instead (Required)
case failed, missed some rows
image

### 4. What is your TiDB version? (Required)
master
308541405f4e6f78cee2ff0b05de2209cc168000

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.