Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutiple lightning parall import failed for Table 'lightning_metadata.task_meta' doesn't exist #39961

Open
lilinghai opened this issue Dec 15, 2022 · 5 comments
Labels
affects-6.6 affects-7.0 affects-7.1 affects-8.1 component/lightning This issue is related to Lightning of TiDB. may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 severity/major type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mutiple lightnings parally import a big table and one failed the error as follows:

[2022/12/15 13:45:05.085 +08:00] [ERROR] [table_restore.go:352] ["import whole table failed"] [table=`sysbench`.`sbtest1`] [takeTime=58m25.400698161s] [error="check tasks exclusively failed: fetch task metas failed: Error 1146 (42S02): Table 'lightning_metadata.task_meta' doesn't exist"]
[2022/12/15 13:45:05.085 +08:00] [ERROR] [restore.go:1576] ["restore table failed"] [table=`sysbench`.`sbtest1`] [takeTime=58m25.415093818s] [error="[Lightning:Restore:ErrRestoreTable]restore table `sysbench`.`sbtest1` failed: check tasks exclusively failed: fetch task metas failed: Error 1146 (42S02): Table 'lightning_metadata.task_meta' doesn't exist"]
[2022/12/15 13:45:05.086 +08:00] [WARN] [util.go:183] ["check and finish schedulers failed with no retry"] [retryCnt=0] [error="fetch task meta failed: Error 1146 (42S02): Table 'lightning_metadata.task_meta' doesn't exist"]

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Dec 15, 2022
@jebter jebter added severity/major component/lightning This issue is related to Lightning of TiDB. labels Dec 18, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 labels Dec 18, 2022
@niubell niubell closed this as completed Apr 27, 2023
@kennytm
Copy link
Contributor

kennytm commented Jun 25, 2023

@niubell hello, this issue has been closed as "completed", but I don't see any PR linking to this issue. Is this actually fixed or is it "WONTFIX"? Thanks.

@lance6716
Copy link
Contributor

lance6716 commented Nov 7, 2023

A customer reports this issue again, we at least need to write a conclusion here. I'll check the log from the customer to locate it soon.

@lance6716 lance6716 reopened this Nov 7, 2023
@lance6716
Copy link
Contributor

lance6716 commented Nov 14, 2023

I checked the code based on v6.5.5.

if cleanup is true, task_meta table will be dropped

// clean up task metas
if cleanup {
logTask.Info("cleanup task metas")
if cleanupErr := rc.taskMgr.Cleanup(context.Background()); cleanupErr != nil {
logTask.Warn("failed to clean task metas, you may need to restore them manually", zap.Error(cleanupErr))
}

And we need the log of every lightning instances to know the timeline. One possible cause is when a slow lightning is running between "create task_meta" and "record its task state", another fast one got true cleanup and dropped the table

@mittalrishabh
Copy link
Contributor

Hi i would like to know why are we dropping this table. We can make it similar to table_meta. And also this table seems like a legacy table. I don't see much use of this table. Are you planning to remove it in 7.5

@okJiang
Copy link
Member

okJiang commented Nov 16, 2023

And also this table seems like a legacy table. I don't see much use of this table. Are you planning to remove it in 7.5

@mittalrishabh It has not been removed. We just renamed it to task_meta_v2. https://github.com/pingcap/tidb/blob/master/br/pkg/lightning/importer/import.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.6 affects-7.0 affects-7.1 affects-8.1 component/lightning This issue is related to Lightning of TiDB. may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

9 participants