ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER & ndb_drop_index

MySql Cluster 中慎用ndb_drop_index命令,否则会导致 ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER

官方文档中对这个命令的描述:
ndb_drop_index drops the specified index from an NDB table.
It is recommended that you use this utility only as an example for writing NDB API applications。

1.用ndb_drop_index删除一个ndbcluster表的索引


$ndb_drop_index -c localhost  testuser idx_testuser_id  -d testdb

Dropping index testuser/idx_testuser_id...OK
NDBT_ProgramExit: 0 - OK

2.访问删除索引的表,正常。

$ ndb_select_all -d testdb testuser;


ID      id   loginName       Passwd  role    SupplierName    Status  CreateUser      CreateTime      TotalOnlineTime mobileNumisOpenMobile
0 rows returned

NDBT_ProgramExit: 0 - OK

3.关闭集群


$ $HOME/mysqlc/bin/mysqladmin -u root -h 127.0.0.1 -P 5000 shutdown -p
$ $HOME/mysqlc/bin/ndb_mgm -e shutdown

4.重启集群后在访问用ndb_drop_index删除索引的表


$ ndb_mgmd -f   $HOME/my_cluster/conf/config.ini
MySQL Cluster Management Server mysql-5.5.19 ndb-7.2.4

mysql> select count(1) from testuser;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER

官方文档中的描述:
In such a case, your only option for making the table available to MySQL again is to drop the table
and re-create it. You can use either the SQL statement DROP TABLE or the ndb_drop_table utility
to drop the table.


这种情况只能drop掉这个表并重建,才能访问。当然如果表中有数据也会丢失。


mysql> drop table testuser;
Query OK, 0 rows affected (0.04 sec)

不知道为什么这么设计ndb_drop_index,使用ndb_drop_index删除索引后表都不能用了。
使用drop index 则没有这个问题。希望ndb_drop_index的功能在新的版本中有所改进。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值