After creating the table and immediately loading data, there is a chance that the report does not exist

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

Original topic: create table之后 立马load data,有几率存在报表不存在

| username: 大钢镚13146

After creating a table through a program on TiDB and then loading data, there is a chance of reporting that the table structure does not exist. However, when checking afterward, the table can be found. It is suspected that there is an issue with multi-node scheduling. For example, in a three-node setup, if two nodes successfully create the table but one node fails, it returns an error. Then, when loading data into the table that hasn’t been successfully created, an error is reported. This issue has also occurred in OB, but they have parameters to control whether this is an asynchronous process, a synchronous return process, or to control the asynchronous return time. I would like to ask if TiDB also has such parameters.

| username: 大飞哥online | Original post link

If there are 3 TiDB servers, and one creates it while another immediately loads it, will it report that it does not exist?

| username: zhanggame1 | Original post link

Do you indeed return a successful table creation message before loading data?

| username: 大钢镚13146 | Original post link

Using an entry point

| username: 大钢镚13146 | Original post link

It should be integrated into the program.

| username: zhanggame1 | Original post link

See if there are multiple threads running.

| username: ShawnYan | Original post link

After creating the table, did you check admin show ddl jobs? Confirm that the DDL has been completed before loading data.

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

The CREATE TABLE operation is a DDL operation, while LOAD DATA is a DML operation. Could it be that the DDL operation hasn’t completed yet? Use ADMIN SHOW DDL JOBS; to check the start and end times of the table creation.

| username: Kongdom | Original post link

It feels like when it’s not the same TiDB owner, this situation might occur.

| username: redgame | Original post link

Use SHOW TABLES; to confirm that the table has been successfully created and is visible on all nodes before proceeding.

| username: YuchongXU | Original post link

It’s just a bit slower.

| username: system | Original post link

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