Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: DM报错restoring count greater than total count for table[table_name]
【TiDB Usage Environment】Production
【TiDB Version】V5.2.2
【DM Version】dmctl/v6.1.0
【Encountered Issue】Full dump load sync of multiple upstream RDS MySQL databases, one of the database tables reported an error
【Issue Phenomenon and Impact】Error reported during the dump stage
"stage": "Paused",
"unit": "Load",
"result": {
"isCanceled": false,
"errors": [
{
"ErrCode": 24006,
"ErrClass": "checkpoint",
"ErrScope": "internal",
"ErrLevel": "medium",
"Message": "restoring count greater than total count for table[table name xxx]",
"RawCause": "",
"Workaround": ""
}
],
The table structure of the reported error has been compared and is consistent with the table structure of other databases.
Please provide the dm-worker logs.
It seems like a bug. Have you enabled relay?
opened 07:28AM - 19 Oct 21 UTC
type/bug
severity/minor
area/dm
found/automation
### What did you do?
only one worker in this scenario
1. start task A in `all`… mode
2. start relay
- task A finished `load` and get into `sync`, so all dumped files are removed, but before `sync` starts it wait at `unitTransWaitCondition`(inside `SubTask.run()`) for relay is enabled, so got no chance to save a `sync` checkpoint
- then `EnableRelay` starts to `resetAllSubTasks`, a new `load` unit is created for it's the last unit that is not fresh and begin running
- `load` found no dumped files but got one file from checkpoint(already finished), then reported an error(in `CalcProgress`)
not that easy to repeat this bug. i write a script to start 4 tasks and start relay immediately may repeat it sometimes.
### What did you expect to see?
no error
### What did you see instead?
error
### Versions of the cluster
DM version (run `dmctl -V` or `dm-worker -V` or `dm-master -V`):
```console
# bin/dm-master -V
Release Version: v2.0.0-beta.2-555-gaf5f7e2-dev
Git Commit Hash: af5f7e2d8f63deda79812140b3c414474be7efd3
Git Branch: relay-notify
UTC Build Time: 2021-10-18 10:59:58
Go Version: go version go1.17.2 linux/amd64
```
### current status of DM cluster (execute `query-status` in dmctl)
```console
(paste current status of DM cluster here)
```
The issue mentions version V2, but I am currently using V6.1.0.
How can I check the configuration of the relay log?
The relaylog configuration file shows that this issue is still open for different versions.
[2022/07/05 08:33:31.332 +08:00] [ERROR] [loader.go:732] ["calc load process"] [task=task-name-xxx] [unit=load] [error="[code=24006:class=checkpoint:scope=internal:level=medium], Message: restoring count greater than total count for table[table-name-xxx]"]
[2022/07/05 08:33:31.332 +08:00] [INFO] [subtask.go:315] ["unit process returned"] [subtask=task-name-xxx] [unit=Load] [stage=Paused] [status="{\"progress\":\"100.00 %\",\"metaBinlog\":\"(mysql-bin.000663, 127800)\",\"metaBinlogGTID\":\"033599ea-7b6d-11ec-80d9-b8599f37f088:1-21693957,584da0f6-2b37-11ec-b023-0c42a1df22b4:1-51405854,8c9840f4-ebf4-11ea-ab97-506b4bfece4c:1-130374091,b790db32-d621-11ea-87fe-00163e32315a:1-43242323,bc662633-ebf4-11ea-b981-506b4bfe81cc:1\"}"]
[2022/07/05 08:33:31.332 +08:00] [INFO] [loader.go:809] ["stop importing data process"] [task=task-name-xxx] [unit=load]
[2022/07/05 08:33:31.332 +08:00] [ERROR] [subtask.go:336] ["unit process error"] [subtask=task-name-xxx] [unit=Load] ["error information"="ErrCode:24006 ErrClass:\"checkpoint\" ErrScope:\"internal\" ErrLevel:\"medium\" Message:\"restoring count greater than total count for table[table-name-xxx]\" "]
I checked the configuration of task and source, and neither has relay enabled.
Please provide the complete log.
I don’t want to play anymore, can I leave?
After switching to V5.3.0 dmctl, stop-task was successful.
tiup dmctl --master-addr x.x.x.x:8261 stop-task task-xxxxx
Starting component `dmctl`: /root/.tiup/components/dmctl/v6.1.0/dmctl/dmctl --master-addr x.x.x.x:8261 stop-task task-xxxxx
{
"op": "Delete",
"result": false,
"msg": "[code=38041:class=dm-master:scope=internal:level=medium], Message: invalid op 7 on task",
"sources": [
]
}
# At this point, switch to /root/.tiup/components/dmctl/v5.3.0/dmctl
./dmctl --master-addr x.x.x.x:8261 stop-task task-xxxxx
{
"op": "Stop",
"result": true,
"msg": "",
"sources": [
{
"result": true,
"msg": "",
Could you provide the complete log?
The “invalid op” issue might be caused by a version mismatch between dmctl and DM: dm v5.4.0执行stop-task 返回 invalid op 7 on task - TiDB 的问答社区
You can specify the dmctl version or upgrade dmctl to match the DM version.
It’s too troublesome to desensitize the complete log.
How to keep the DM version consistent with dmctl? I only know how to specify the version of dmctl. The version number of DM is not consistent with dmctl and TiDB. How to adapt?
Check if there are escape characters in the string data of the original file for the error “restoring count greater than total count for table”. It is possible that escape characters split one row of data into two or even multiple rows.
Since DM 5.4 and later, the version number changes with the TiDB release version number. Refer to DM 5.3.0 Release Notes | PingCAP 文档中心
This topic will be automatically closed 60 days after the last reply. No new replies are allowed.