Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: TiKV和TiFlash查询结果不一致

[TiDB Usage Environment] Production Environment
[TiDB Version] v5.4.1
[Reproduction Path] Honestly, not sure how it happened
[Encountered Problem: Symptoms and Impact]
In short, the data queried from TiKV and TiFlash is inconsistent.
Specifically:
- The following SQL query returns three rows using the TiFlash engine.
- Using coupe_code as the query condition, only 2 rows are returned, missing the one with id 2042783592.
From the execution plan, it shows that the data is queried using TiKV.
- Directly querying the record with id 2042783592
The execution plan shows rocksdb’s delete_skipped_count as 1 and key_skipped_count as 1.
So, does this mean that this data in TiKV has been deleted and thus cannot be found?
- Trying different engines
The same SQL, using Hint to force TiKV engine, returns only 2 records, while TiFlash returns 3 records. So, is this a bug?
- Other attempts
Checked the TIFLASH_REPLICA table and found no issues.
Checked Github issues and found no similar issues.
Checked the community, this TiFlash数据不一致 - TiDB 的问答社区 is somewhat similar but not the same.
Request: Please help confirm if this is a bug, thank you.
[Resource Configuration]
- 3 PD: Total 24 CPU, 48G memory
- 8 TiDB: Total 148 CPU, 1 TB+ memory
- 24 TiKV: Total 168 CPU, 3 TB+ memory
- 2 TiFlash: Total 56 CPU, 1TB+ memory
[Attachments: Screenshots/Logs/Monitoring]