Error Executing Task When Importing Data Using DM

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

Original topic: 使用dm导入数据,执行任务报错

| username: 朵拉大虾

[TiDB Usage Environment] Testing
[TiDB Version] 6.5.0
[Reproduction Path] Error occurs when executing tasks
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]


| username: 朵拉大虾 | Original post link

This is the task yml file.

| username: 朵拉大虾 | Original post link

This is the source file.

| username: 裤衩儿飞上天 | Original post link

The performance of TiDB is indeed impressive. In our production environment, we have observed that it can handle high concurrency and large volumes of data with ease. The horizontal scalability is particularly beneficial for our growing business needs.

| username: Zhang_Zhi | Original post link

Take a look at the table structure of the table that is reporting an error.

| username: 朵拉大虾 | Original post link

What does this mean?

| username: 朵拉大虾 | Original post link

This one?

| username: tidb狂热爱好者 | Original post link

Your table is not auto-incrementing. It skips days, or you need to set an auto-increment primary key.

| username: 朵拉大虾 | Original post link

Is it my upstream table or downstream table? The id field in my upstream table is auto-incremented.

| username: 考试没答案 | Original post link

The upstream table. Check if it’s the same table.

| username: 考试没答案 | Original post link

After stopping the task, try restarting it.

| username: CuteRay | Original post link

Actually, there are just two issues. First, foreign keys in TiDB are only syntax-compatible but not functionally supported, and they generate a warning. Second, DM synchronization requires that the upstream tables have a primary key or unique index. You should check whether these two tables have primary keys or unique indexes.

| username: 朵拉大虾 | Original post link

These two tables have exactly the same structure and were created using the same SQL file.

| username: CuteRay | Original post link

Just take a look, use “show create table” to check if there are primary keys and unique indexes.

| username: 朵拉大虾 | Original post link

The images you provided are not visible. Please provide the text content for translation.

| username: CuteRay | Original post link

The issue is the lack of a primary key upstream. Just create the primary key, and it will be fine.
DM Data Migration Best Practices | PingCAP Documentation Center

Read more books, read more newspapers, and read more documentation in the future.

| username: system | Original post link

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