Achieving master-slave synchronization through pump + drainer, but with some delay

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

Original topic: 通过pump + drainer来实现主从同步,但存在一定延迟。

| username: 答辩潮人

[TiDB Usage Environment] Production Environment
[TiDB Version] 4.0.15
[Reproduction Path] Delay between master and slave
[Encountered Problem: Phenomenon and Impact]
Not sure if it will affect master-slave synchronization

image

| username: 像风一样的男子 | Original post link

Check the monitoring of the replica to see if the performance has reached its bottleneck.

| username: 答辩潮人 | Original post link

I have already adjusted the txn-batch and worker-count parameters, and the threads are also in a sleep state. There is also high latency from pump to drainer.

| username: 答辩潮人 | Original post link

Look at those metrics.

| username: Fly-bird | Original post link

Insufficient performance of the replica.

| username: Fly-bird | Original post link

Check the dashboard of the replica.

| username: 答辩潮人 | Original post link

The image is not available for translation. Please provide the text content directly.

| username: 芮芮是产品 | Original post link

It’s too old technology, and it would be better to put TiDB resources together.

| username: songxuecheng | Original post link

It is normal for the primary database to have delays due to large transaction binlogs.

| username: 答辩潮人 | Original post link

How do you check here if it’s a large transaction or parse the binlog, just like MySQL?

| username: songxuecheng | Original post link

Check the drainer logs, there will be a prompt for large binlogs.

| username: 答辩潮人 | Original post link

Are there any keywords?

| username: songxuecheng | Original post link

The image is not visible. Please provide the text you need translated.

| username: 答辩潮人 | Original post link

No large transactions.

| username: TiDBer_小阿飞 | Original post link

What’s going on with your PD timestamp wait? GC? Memory? Network?

| username: 答辩潮人 | Original post link

The problem is right here, why is there a delay?

| username: Billmay表妹 | Original post link

The moderator said it!

| username: songxuecheng | Original post link

You should search for these keywords.

| username: TiDBer_小阿飞 | Original post link

Check what transactions these large logs are performing.

| username: 答辩潮人 | Original post link

The screenshot already shows no large transactions.