Drainer cannot start

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

Original topic: drainer起不来

| username: Hacker_qeCXjAN2

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Problem Phenomenon and Impact]
Drainer failed to start. The logs indicate that TSO is slow, but after checking the monitoring panel, no issues were found. Logs:
[2023/09/18 13:44:23.097 +08:00] [INFO] [version.go:50] [“Welcome to Drainer”] [“Release Version”=v5.0.0] [“Git Commit Hash”=d2dfe95e502ea2bb83d0ff6be3f2059bd2c43dce] [“Build TS”=“2021-04-06 04:38:50”] [“Go Version”=go1.13] [“Go OS/Arch”=linux/amd64]
[2023/09/18 13:44:23.097 +08:00] [INFO] [main.go:46] [“start drainer…”] [config=“{"log-level":"info","node-id":"","addr":"","advertise-addr":"","data-dir":"/data_back/drainer_data-8249","detect-interval":5,"pd-urls":",,","log-file":"/data_back/drainer_deploy-8249/log/drainer.log","initial-commit-ts":428691487294750737,"sycner":{"sql-mode":null,"ignore-txn-commit-ts":null,"ignore-schemas":.…]
[2023/09/18 13:44:23.098 +08:00] [INFO] [client.go:193] [”[pd] create pd client with endpoints"] [pd-address=“[,,]”]
[2023/09/18 13:44:23.103 +08:00] [INFO] [base_client.go:308] [“[pd] switch leader”] [new-leader=] [old-leader=]
[2023/09/18 13:44:23.104 +08:00] [INFO] [base_client.go:112] [“[pd] init cluster id”] [cluster-id=6835126175440185974]
[2023/09/18 13:44:23.104 +08:00] [INFO] [server.go:121] [“get cluster id from pd”] [id=6835126175440185974]
[2023/09/18 13:44:23.104 +08:00] [INFO] [client.go:577] [“[pd] tso dispatcher is not ready, wait for a while”]
[2023/09/18 13:44:23.155 +08:00] [WARN] [ts.go:50] [“get timestamp too slow”] [take=50.977852ms]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

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

I didn’t see any errors in the logs. Could you take a closer look to see if there are any error messages?

| username: Hacker_qeCXjAN2 | Original post link

It’s up now, but it occasionally prints the following log:

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

This is an error reported when executing delete on the slave. Try executing it manually and see.

| username: tidb菜鸟一只 | Original post link

Error: The replica cannot connect…

| username: Hacker_qeCXjAN2 | Original post link

Manually connecting works.

| username: tidb菜鸟一只 | Original post link

Can you manually execute the SQL that is causing the error?

| username: Fly-bird | Original post link

Can’t connect, please check.

| username: Soysauce520 | Original post link

Use the sync user to execute the error statement in the downstream database and check for permission issues.