How to understand consistency reads in TiFlash? Does it read the latest data? What principle is it based on?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiFlash的一致性读怎么理解?读取的是最新数据吗?是基于什么原理实现的?

| username: alfred

To improve efficiency, please provide the following information. A clear problem description can help resolve the issue faster:

[Overview] Scenario + Problem Overview

[Application Framework and Development Adaptation Business Logic]

[Background] Actions Taken

[Phenomenon] Business and Database Phenomenon

[Problem] Current Issue Encountered

[Business Impact]

[TiDB Version]

[Attachments] Relevant Logs and Monitoring (https://metricstool.pingcap.com/)


For questions related to performance optimization and troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output results for upload.

| username: yilong | Original post link

Consistency

TiFlash provides snapshot isolation support similar to TiKV and ensures that the latest data can be read (ensuring that previously written data can be read). This consistency is achieved through replication progress verification of the data.

Each time a read request is received, the Region replica in TiFlash initiates a progress check with the Leader replica (a very lightweight RPC request). The read response is only given when the progress ensures that the data covered by the read request timestamp is included.

| username: 张雨齐0720 | Original post link

The data read conforms to your current isolation level.
It will pull data from TiKV and then read the correct data that matches your isolation level.

| username: alfred | Original post link

This means that there will be a proofreading of the replication progress, and if the delay is significant, it will not use TiFlash.

| username: yilong | Original post link

It depends on the parameter settings.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.