Bug #120417 MY-013028] [InnoDB] MySQL is freeing a thd though trx->n_mysql_tables_in_use is X and trx->mysql_n_tables_locked is Y
Submitted: 8 May 6:22
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.40 OS:Linux
Assigned to: CPU Architecture:x86

[8 May 6:22] Shane Bester
Description:
Error logs are getting many of these:

2026-01-08T16:00:16.714456+05:30 2010676 [ERROR] [MY-010876] [InnoDB] Transaction not registered for MySQL 2PC, but transaction is active
2026-01-08T16:00:25.628710+05:30 2010676 [ERROR] [MY-010876] [InnoDB] Transaction not registered for MySQL 2PC, but transaction is active
2026-01-08T16:01:13.851682+05:30 2010676 [ERROR] [MY-010876] [InnoDB] Transaction not registered for MySQL 2PC, but transaction is active

2026-01-08T19:55:55.384908+05:30 2010676 [ERROR] [MY-013028] [InnoDB] MySQL is freeing a thd though trx->n_mysql_tables_in_use is 4294967280 and trx->mysql_n_tables_locked is 26.
TRANSACTION 283984123810488, not started
mysql tables in use 4294967280, locked 26
0 lock struct(s), heap size 1128, 0 row lock(s)
len 768; hex <cut>

Notice this "mysql tables in use 4294967280" seems like something wrapped around.

How to repeat:
We could not repeat this on demand.  So we need some ideas how it can be repeated.