$ vttablet -version
Version: 13.0.0-SNAPSHOT (Git revision 131148d3af branch 'main') built on Tue Nov 9 16:33:43 PST 2021 by jacques@dhoomdeskw.localdomain using go1.17.1 linux/amd64
It seems that the root cause of the problem is the table + size query in go/mysql/flavor_mysql.go, e.g. for MySQL 8.0 it has:
SELECT t.table_name, t.table_type, unix_timestamp(t.create_time), t.table_comment, i.file_size, i.allocated_size
FROM information_schema.tables t, information_schema.innodb_tablespaces i
WHERE t.table_schema = database() and i.name = concat(t.table_schema,'/',t.table_name)
This does not work for partitioned tables, since the innodb_tablespaces.name field for partitioned tables adds a #p#partition_name to the end of the schema + table_name string, e.g. something like:
mysql> select name from information_schema.innodb_tablespaces where name like '%t1%';
+----------------------+
| name |
+----------------------+
| vt_unsharded/t1#p#p0 |
| vt_unsharded/t1#p#p1 |
| vt_unsharded/t1#p#p2 |
| vt_unsharded/t1#p#p3 |
| vt_unsharded/t1#p#p4 |
| vt_unsharded/t1#p#p5 |
| vt_unsharded/t1#p#p6 |
| vt_unsharded/t1#p#p7 |
| vt_unsharded/t1#p#p8 |
| vt_unsharded/t1#p#p9 |
+----------------------+
instead of just vt_unsharded/t1 which the query expects.
Current main branch:
Unsharded keyspace:
VSchema with single table (although problem occurs with empty VSchema too):
Create a partitioned table, called
t1
via vtgate:This works fine, e.g.:
However, if you try to do anything with vreplication against that table, it doesn't work, e.g. online DDL with the
online
(vreplication) strategy:Now, check the migration status:
It will stay in running state, and then eventually, after the 10+ minutes, time out as
failed
:Looking at the tablet logs, we see this error over and over:
Checking
/schemaz
confirms that this table is not seen by the schema engine:i.e.
t1
nowhere in sight.It seems that the root cause of the problem is the table + size query in
go/mysql/flavor_mysql.go
, e.g. for MySQL 8.0 it has:This does not work for partitioned tables, since the
innodb_tablespaces.name
field for partitioned tables adds a#p#partition_name
to the end of the schema + table_name string, e.g. something like:instead of just
vt_unsharded/t1
which the query expects.