How to Synchronize TiDB Data to TiFlash? Is There Any Latency?

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

Original topic: TiDB数据如何同步到TiFlash?是否有延迟?

| username: alfred

【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】
【Encountered Issues】
【Reproduction Path】What operations were performed that led to the issue
【Issue Phenomenon and Impact】
【Attachments】

  • Relevant logs, configuration files, Grafana monitoring (https://metricstool.pingcap.com/)
  • TiUP Cluster Display information
  • TiUP Cluster Edit config information
  • TiDB-Overview monitoring
  • Corresponding module’s Grafana monitoring (if any, such as BR, TiDB-binlog, TiCDC, etc.)
  • Corresponding module logs (including logs from 1 hour before and after the issue)

If the question is related to performance optimization or troubleshooting, please download and run the script. Please select all and copy-paste the terminal output results for upload.

| username: Raymond | Original post link

TiFlash asynchronously synchronizes data from TiKV as a learner, so the delay is generally not too significant. Consistent queries can also be performed on TiFlash. You can check out the advanced system management course, which covers this topic.

| username: alfred | Original post link

Controllable latency is also acceptable.

| username: ddhe9527 | Original post link

The latency can be ignored. Even if there is latency, TiFlash can ensure consistent reads through Learner Read, meaning it can definitely read the changes of transactions with commit_ts smaller than the read request’s start_ts from TiFlash.

| username: HACK | Original post link

Excerpt from the official documentation:

Consistency Guarantee: TiFlash provides the same snapshot isolation support as TiKV and ensures that the latest data is read (ensuring that previously written data can be read). This consistency is achieved through replication progress verification.
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: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.