Description:
MySQL DB Upgrade failed with error message : mysqld: Duplicate entry 'mysql/slave_worker_info' for key 'tablespaces.name'
Error Log :
2023-11-18T02:43:53.318028Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-11-18T02:43:53.318086Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-25) starting as process 1472
2023-11-18T02:43:53.350371Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2023-11-18T02:43:53.350427Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-11-18T02:44:19.414153Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Duplicate entry 'mysql/slave_worker_info' for key 'tablespaces.name'
2023-11-18T02:44:19.735742Z 1 [ERROR] [MY-011006] [Server] Got error 168 from SE while migrating tablespaces.
2023-11-18T02:44:19.738855Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-11-18T02:44:19.738874Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-11-18T02:44:22.043376Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.33-25) Percona Server (GPL), Release 25, Revision 60c9e2c5.
2023-11-18T03:03:47.770488Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2023-11-18T03:03:47.770887Z 0 [ERROR] [MY-010119] [Server] Aborting
FROM : INNODB_SYS_TABLESPACES
mysql> SELECT * FROM information_schema.INNODB_SYS_TABLESPACES WHERE name like '%slave_worker_info%';
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
| SPACE | NAME | FLAG | FILE_FORMAT | ROW_FORMAT | PAGE_SIZE | ZIP_PAGE_SIZE | SPACE_TYPE | FS_BLOCK_SIZE | FILE_SIZE | ALLOCATED_SIZE |
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
| 5 | mysql/slave_worker_info | 0 | Antelope | Compact or Redundant | 16384 | 0 | Single | 4096 | 98304 | 98304 |
| 1674 | mysql/slave_worker_info | 33 | Barracuda | Dynamic | 16384 | 0 | Single | 4096 | 98304 | 98304 |
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
2 rows in set (0.00 sec)
mysql> drop table slave_worker_info;
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT * FROM information_schema.INNODB_SYS_TABLESPACES WHERE name like '%slave_worker_info%';
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
| SPACE | NAME | FLAG | FILE_FORMAT | ROW_FORMAT | PAGE_SIZE | ZIP_PAGE_SIZE | SPACE_TYPE | FS_BLOCK_SIZE | FILE_SIZE | ALLOCATED_SIZE |
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
| 5 | mysql/slave_worker_info | 0 | Antelope | Compact or Redundant | 16384 | 0 | Single | 0 | 0 | 0 |
+-------+-------------------------+------+-------------+----------------------+-----------+---------------+------------+---------------+-----------+----------------+
1 row in set (0.00 sec)
How to repeat:
NA