signal18 / replication-manager

Signal 18 repman - Replication Manager for MySQL / MariaDB / Percona Server
https://signal18.io/products/srm
GNU General Public License v3.0
647 stars 167 forks source link

get error Table 'mysql.gtid_slave_pos' doesn't exist in engine #777

Closed masao77 closed 6 days ago

masao77 commented 1 month ago

Hi,

On 2 debian12 servers, i create a symlink /var/lib/mysql ->/opt/mysql, and install mariadb (on debian, the install of the package creates the datadir in /opt/mysql). I don't change any configuration on mariadb (except listening to 0.0.0.0 and create the user for replication-manager)

The table is working:

MariaDB [mysql]> show create table gtid_slave_pos;
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table          | Create Table                                                                                                                                                                                                                                                                                                                                        |
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| gtid_slave_pos | CREATE TABLE `gtid_slave_pos` (
  `domain_id` int(10) unsigned NOT NULL,
  `sub_id` bigint(20) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `seq_no` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`domain_id`,`sub_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='Replication slave GTID position' |
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)

I add the cluster in replication-manager. From replication-manager i stop and start the database. Then i got the error:

MariaDB [mysql]> show create table gtid_slave_pos;
ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine

It looks like the tablespace (.ibd file) is not associated anymore with the table (.frm file). Potentially, other tables have the same issue.

caffeinated92 commented 1 month ago

Hi @masao77,

Thank you for your information. I will try to resolve this as soon as possible.

masao77 commented 1 month ago

FYI, same issue when we keep the datadir in /var/lib/mysql.

Tried to reimport tablespace, but i can't:

MariaDB [mysql]> show create table gtid_slave_pos;
ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine
MariaDB [mysql]> ALTER TABLE gtid_slave_pos DISCARD TABLESPACE;
ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine
MariaDB [mysql]> ALTER TABLE gtid_slave_pos IMPORT TABLESPACE;
ERROR 1932 (42S02): Table 'mysql.gtid_slave_pos' doesn't exist in engine
masao77 commented 1 month ago

It works without issue when i add the tag 'nosplitpath'!

caffeinated92 commented 1 month ago

Thanks for the feedback. We will do our best to cater your needs!