Percona Server 5.7 orphan #sql-ib* entry in INNODB_SYS_TABLES cannot be removed, blocks MySQL 8 upgrade

Hello,

I am running Percona Server 5.7.44-48 on a large dataset (~9 TB).
This instance is a replica / test clone, not production.

While running util.checkForServerUpgrade() (MySQL Shell) in preparation for an upgrade to MySQL / Percona 8.0, I am getting the following blocking error:

Schema inconsistencies resulting from file removal or corruption

Table kep.#sql-ib197-3868964134 is present in
INFORMATION_SCHEMA.INNODB_SYS_TABLES
but missing from TABLES table

Querying the metadata confirms this:

SELECT * 
FROM information_schema.INNODB_SYS_TABLES
WHERE NAME LIKE 'kep/#sql%';

Result:

NAME:  kep/#sql-ib197-3868964134
SPACE: 595

This looks like an orphan InnoDB internal table left behind by a failed or interrupted ALTER TABLE operation.


What I already tried

  • Connecting as root@localhost via UNIX socket

  • DROP TABLE IF EXISTS kep.\#sql-ib197-3868964134`;`

  • Restarting MySQL

  • Starting MySQL with innodb_force_recovery = 1

  • Retrying DROP TABLE

  • Restarting again without innodb_force_recovery

The table remains present in INNODB_SYS_TABLES and cannot be removed.

Important note:

  • On Percona Server 5.7, INNODB_SYS_* tables are read-only, so manual deletion from information_schema is not possible.

Key constraints

  • Dataset size is ~9 TB (dropping/reloading schemas is not practical)

  • This is a replica/test node, but data should remain intact

  • I want to prepare the instance safely for an upgrade to Percona 8.0

  • I want to avoid unsupported hacks or ibdata file manipulation


Questions

  1. Is this a known issue / bug in Percona Server 5.7 regarding orphan #sql-ib* entries?

  2. Is there a supported way to clean up this orphan InnoDB metadata in 5.7?

  3. Can this orphan entry be safely ignored when upgrading Percona Server 5.7 → Percona Server 8.0, or does it risk upgrade failure?

  4. Would Percona recommend:

    • in-place upgrade,

    • or creating a new Percona 8.0 instance and cloning data into it?

Any guidance from Percona engineers or users who have faced a similar situation would be greatly appreciated.

Thank you.

Extra:

-rw-r----- 1 mysql mysql 14K Dec 22 02:06 ‘#sql-1db9_2584d28.frm’
-rw-r----- 1 mysql mysql 52M Dec 21 04:38 ‘#sql-ib197-3868964134.ibd’

You need to fix this on 5.7 by following the steps mentioned in the documentation section below
https://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html#:~:text=deleting%20it%20manually.-,Orphan%20Intermediate%20Tables,-If%20MySQL%20exits

As per the documentation steps, Drop should look like
mysql> DROP TABLE #mysql50##sql-ib87-856498050;