简体   繁体   中英

mysql ndb alter table failes, cannot drop index

Use case:

We have Jenkin job that runs when developer push code for review. The job validates junit and sonar review and we are planning to add liquibase validation against NDB server. Since we have three Jenkins nodes we have created three schema so its not blocker.

Mysql NDB setup

Have setup mysql ndb cluster using docker on a virtual machine,4 VCPU & 8GB ram . This setup consists of 2 sql nodes, 2 data nodes and 2 manager nodes.

CREATE DATABASE IF NOT EXISTS test1 DEFAULT CHARACTER SET 'utf8' DEFAULT COLLATE 'utf8_general_ci';
CREATE DATABASE IF NOT EXISTS test2 DEFAULT CHARACTER SET 'utf8' DEFAULT   COLLATE 'utf8_general_ci';
CREATE DATABASE IF NOT EXISTS test3 DEFAULT CHARACTER SET 'utf8' DEFAULT COLLATE 'utf8_general_ci';

DataMemory                  = 700M
IndexMemory                 = 256M
MaxNoOfTables               = 4000
MaxNoOfOrderedIndexes       = 700
MaxNoOfAttributes           = 5000

Issue:

same Liquibase runs successfully on first two schema but fails on third one. Check logs don't see any sign of issue/error. Cannot drop index 'xxxxxx': needed in a foreign key constraint

Please help

Thank you

Somehow you are trying to delete an index involved in a foreign key relation. This can probably also happen when you try to ALTER the table using a copying ALTER TABLE since this will recreate the table and thus both drop and add the index.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM