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

get error Information schema is changed. #10282

Closed
z2665 opened this issue Apr 27, 2019 · 7 comments
Closed

get error Information schema is changed. #10282

z2665 opened this issue Apr 27, 2019 · 7 comments
Labels
type/question The issue belongs to a question.

Comments

@z2665
Copy link

z2665 commented Apr 27, 2019

I have a tidb v2.1.8 cluster of three eight-core virtual machines.

I use the tidb as backup db.

So I create about 21 dbs. Before I import data. I will clean tables use

truncate table xxxx;

I started 30 coroutines to exec the statement.
some time I will get some errror about

[ERRO] [            backup.go:731:controller.cleanDB.func1] exec cleandb  error Error 1105: Information schema is changed.

so I have some quesetions:

  1. based the tikv , the truncate schema should be executed very quickly, but it didn't , and I some time I get this error.
  2. How to improve the execution speed of statements.
  3. Is my virtual machine performance too low? But I see that the cpu usage rate of each node is only 20%.
@winkyao
Copy link
Contributor

winkyao commented Apr 28, 2019

Thanks @z2665.
The error "Information schema is changed" will be thrown when the schema change is very frequent.

  1. truncate table is quick, yes it is. But the root reason is not truncating table slowly. That is because of concurrency DDL execution is not optimized by TiDB yet, but we are planning to improve the performance of concurrent DDL.
  2. you can run the ddl serially
  3. The answer is the same as above.

@winkyao winkyao added the type/question The issue belongs to a question. label Apr 28, 2019
@z2665
Copy link
Author

z2665 commented Apr 28, 2019

@winkyao Thanks for your answer

run the ddl serially

it mesns like this?

truncate table xxxx;truncate table yyyy;truncate table zzz;

I have tested the above statement and concurrently executed 24 coroutines to execute truncate table, but the result is that their total execution time is similar.

it will spend 1m40s with use mysqldump imports data. How do I make it faster?
I hope that the time will be less than 1 minute.

@winkyao
Copy link
Contributor

winkyao commented Apr 28, 2019

No, could you run ddl in one goroutine? @z2665

@z2665
Copy link
Author

z2665 commented Apr 28, 2019

No, could you run ddl in one goroutine?

I try run ddl in one goroutine. There has two results

  1. Different databases are executed in different goroutine, for a total of 21 goroutine. It spend time likes 24*21 goroutine. I think It gets optimized. but unfortunately, it does not improve the overall speed.
  2. Different databases are executed in one goroutine. It speed is more slow. Spend about 5min.
    Now I think I may to improve the speed of import.

@winkyao
Copy link
Contributor

winkyao commented Apr 28, 2019

@z2665 Could you use master tidb to test your workload? #10170 fixed one of issue of creating table and create database slowly. But one thing maybe you should know is that DDL jobs in TiDB are handled serially now. If you run it parallelly, it will cause many transaction conflicts, caused by TiDB trying to enqueue the job to the jobs queue. So if you want to finish all your ddl jobs fastly, you'd better run them one by one, including create database, create table, or something else.

@winkyao
Copy link
Contributor

winkyao commented Apr 28, 2019

We are working on concurrency running ddl, but at this time, the optimized way is run ddl one by one. @z2665

@z2665
Copy link
Author

z2665 commented Apr 28, 2019

@winkyao Thanks for your help.
I tried v3beta earlier, when I import the table structure it will be faster than 2.1.8, but the execution of the truncate statement says that the time spent is not much different.
Now. I don't have other questions.
Thanks for your work and look forward to the new version.

@z2665 z2665 closed this as completed Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question The issue belongs to a question.
Projects
None yet
Development

No branches or pull requests

2 participants