You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mysqld.GetSchema() is susceptible to two race conditions. One leading to a Table X doesn't exist (errno 1146) error, and the other to silent missing PK information.
The race conditions both happen when a table is dropped after the initial call to collectBasicData():
In this scenario, there's no error here, because we get PK information from information_schema. But we will have missing data in the table definition (nil value for PrimaryKeyColumns).
Either way, it's valid for a table to be dropped during this time. The fix is to identify that a table has been dropped, and silently ignore such table.
This affects anything that attempts to ReloadSchema, which means any VReplication or Online DDL operations.
Reproduction Steps
Binary Version
-
Operating System and Environment details
-
Log Fragments
No response
The text was updated successfully, but these errors were encountered:
The 2nd race condition holds true, but identifying it is a bit more complex. The fact that a table does not appear in INFORMATION_SCHEMA.STATISTICS does not mean the table does not exist - it may exist and have no indexes.
Overview of the Issue
Mysqld.GetSchema()
is susceptible to two race conditions. One leading to aTable X doesn't exist (errno 1146)
error, and the other to silent missing PK information.The race conditions both happen when a table is dropped after the initial call to
collectBasicData()
:vitess/go/vt/mysqlctl/schema.go
Line 90 in e8dc004
1st race condition: a table is dropped right after this query, and before iterating the table for
collectSchema()/.GetColumns()
:vitess/go/vt/mysqlctl/schema.go
Line 110 in e8dc004
in this scenario, we get a
Table X doesn't exist (errno 1146)
, because we activelySELECT
from the table that is now dropped.2nd race condition: a table is dropped right before analyzing primary keys:
vitess/go/vt/mysqlctl/schema.go
Line 131 in e8dc004
In this scenario, there's no error here, because we get PK information from
information_schema
. But we will have missing data in the table definition (nil
value forPrimaryKeyColumns
).Either way, it's valid for a table to be dropped during this time. The fix is to identify that a table has been dropped, and silently ignore such table.
This affects anything that attempts to
ReloadSchema
, which means any VReplication or Online DDL operations.Reproduction Steps
Binary Version
Operating System and Environment details
Log Fragments
No response
The text was updated successfully, but these errors were encountered: