tidb
tidb copied to clipboard
TiDB schema diff is wrong
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Load ch-benchmark(warehouse=1500) with tiflash replica using BR;
2. What did you expect to see? (Required)
All tables created in tiflash with no error;
3. What did you see instead (Required)
If print schema diff in tiflash log we can see the following two lines:
["SchemaDiff::deserialize:schema diff raw data {\"version\":35,\"type\":60,\"schema_id\":68,\"table_id\":0,\"old_table_id\":0,\"old_schema_id\":0,\"affected_options\":[{\"schema_id\":68,\"table_id\":70,\"old_table_id\":70,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":71,\"old_table_id\":71,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":72,\"old_table_id\":72,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":73,\"old_table_id\":73,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":74,\"old_table_id\":74,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":75,\"old_table_id\":75,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":76,\"old_table_id\":76,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":77,\"old_table_id\":77,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":78,\"old_table_id\":78,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":79,\"old_table_id\":79,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":80,\"old_table_id\":80,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":81,\"old_table_id\":81,\"old_schema_id\":68},{\"schema_id\":68,\"table_id\":82,\"old_table_id\":82,\"old_schema_id\":68}]}"]
["SchemaBuilder:Creating table chbenchmark(68).revenue1(76)"]
type: 60
means this is an action of createTables
. But chbenchmark(68).revenue1(76)
is a view which should be in a schema diff of type createView
. So tiflash try to create a table for the view revenue1
but failed to do that and throw an exception.
4. What is your TiDB version? (Required)
master nightly
Maybe it is a ddl related bug? @jebter
@lidezhu Could you provide detailed instructions on how to reproduce this? For example, how the data is prepared with ch-benchmark.
More information like the log of TiDB-server & SHOW CREATE TABLE chbenchmark(68).revenue1(76)
would be also helpful.
Thanks.
Just use br to restore the data can produce the problem. I think this is just br's problem which put view
in create tables
diff.
The tag should be component/br
, this problem should have nothing to do with tiflash. @jebter
can we distinguish the view in tiflash side?
ActionType: 60 is only used for br. actually it's means batchCreateTable with tableInfos. include tables/views.
We can change the action name from CreateTables
to CreateTableAndViews
...
@lidezhu Can you check if this issue is fixed?
/remove-severity major
/severity minor
@BornChanger: The label(s) severity/mionor
cannot be applied, because the repository doesn't have them.
In response to this:
/severity mionor
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.