-
Lakshmi Narayanan Sreethar authored
When a foreign key is added or dropped as a part of any DDL, all the parent tables referenced by the foreign key should be flushed out of the server cache to force reload the FK metadata in the handler. This is already done by the fix for Bug#24666177. When this DDL is distributed to other mysqlds connected to the same cluster, the same is not being done as a part of schema distribution. Due to this any subsequent queries relying on the foreign key metadata information of the corresponding parent tables might return inconsistent results. Fix for versions 7.5 & 7.6: When the DDL query is distributed and reaches the participant mysqld, any previous foreign key information is already lost. Since the server doesn't have any information about the foreign keys and the NdbDictionary has already dropped the foreign key, there is no way to retrieve the foreign keys and the tables being referenced by them. So, the fix is to make ndb_binlog flush out all the tables caches in server whenever the ndb_binlog encounters a DDL that might have added/dropped a foreign key.
Lakshmi Narayanan Sreethar authoredWhen a foreign key is added or dropped as a part of any DDL, all the parent tables referenced by the foreign key should be flushed out of the server cache to force reload the FK metadata in the handler. This is already done by the fix for Bug#24666177. When this DDL is distributed to other mysqlds connected to the same cluster, the same is not being done as a part of schema distribution. Due to this any subsequent queries relying on the foreign key metadata information of the corresponding parent tables might return inconsistent results. Fix for versions 7.5 & 7.6: When the DDL query is distributed and reaches the participant mysqld, any previous foreign key information is already lost. Since the server doesn't have any information about the foreign keys and the NdbDictionary has already dropped the foreign key, there is no way to retrieve the foreign keys and the tables being referenced by them. So, the fix is to make ndb_binlog flush out all the tables caches in server whenever the ndb_binlog encounters a DDL that might have added/dropped a foreign key.
Loading