While debugging T427187: ToolsDB disk space usage growing too fast I noticed the MariaDB "Transaction History Length" is growing too much:
This looks like a repeat of T409716: [toolsdb] ibdata1 growing on primary, the size of ibdata1 is slowly increasing:
- 2026-05-25: 142G
- 2026-06-04: 163G
SHOW ENGINE INNODB STATUS\G is showing some stuck queries for user s52323 (dimastbkbot):
---TRANSACTION (0x7f02997bd700), ACTIVE 3340 sec mysql tables in use 9, locked 0 0 lock struct(s), heap size 1128, 0 row lock(s) MariaDB thread id 599777751, OS thread handle 139614768051904, query id 25837671024 172.16.4.204 s52323 Sending data SELECT anon_1.template_id, anon_1.page_id, anon_1.id, anon_1.value, anon_1.value_1, anon_1.namespace_id, anon_1.title, template_1.redirect_id, template_1.title AS title_1, template_1.id AS id_1, namespace_1.number, namespace_1.name, namespace_1.id AS id_2, page_1.wiki_id, page_1.namespace_id AS namespace_id_1, page_1.title AS title_2, page_1.id AS id_3, param_1.page_template_id, param_1.name AS name_1, param_1.value AS value_2, param_1.id AS id_4 FROM (SELECT page_template.template_id AS template_id, page_template.page_id AS page_id, page_template.id AS id, param_2.value AS value, param_3.value AS value_1, page.namespace_id AS namespace_id, page.title AS title FROM page_template INNER JOIN page ON page.id = page_template.page_id INNER JOIN namespace ON namespace.id = page.namespace_id LEFT OUTER JOIN param AS param_2 ON param_2.page_template_id = page_template.id AND param_2.name = 'GTG,boxstyle_ АБС' LEFT OUTER JOIN param AS param_3 ON param_3.page_template_id = page_template.id AND param_3.name = 'Тереза' WHERE page_template.template_id IN (1615) ORDER BY param_2.value ASC, param_3.value ASC, page.namespace_id, page.title LIMIT 0, 50) AS anon_1 LEFT OUTER JOIN template AS template_1 ON template_1.id = anon_1.template_id LEFT OUTER JOIN page AS page_1 ON page_1.id = anon_1.page_id LEFT OUTER JOIN namespace AS namespace_1 ON namespace_1.id = page_1.namespace_id LEFT OUTER JOIN param AS param_1 ON anon_1.id = param_1.page_template_id ORDER BY anon_1.value ASC, anon_1.value_1 ASC, anon_1.namespace_id, anon_1.title Trx read view will not see trx with id >= 167751592329, sees < 167751068720
I tried killing these queries, but the tool is automatically spawning up new ones:
MariaDB [(none)]> SELECT id, time, command, state, host, LEFT(info,50) AS info FROM information_schema.processlist WHERE user = 's52323'; +-----------+------+---------+--------------+--------------------+----------------------------------------------------+ | id | time | command | state | host | info | +-----------+------+---------+--------------+--------------------+----------------------------------------------------+ | 600018621 | 3 | Query | Sending data | 172.16.4.204:35544 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 600017551 | 18 | Query | Sending data | 172.16.4.204:52875 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 600008528 | 166 | Query | Sending data | 172.16.4.204:27493 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599965058 | 800 | Query | Sending data | 172.16.4.204:18217 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599929684 | 1337 | Query | Sending data | 172.16.4.204:62641 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599863260 | 2281 | Query | Sending data | 172.16.4.204:5139 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599845801 | 2546 | Query | Sending data | 172.16.4.204:19631 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599807315 | 3167 | Query | Sending data | 172.16.4.204:18977 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | | 599793774 | 3407 | Query | Sending data | 172.16.4.204:3757 | SELECT anon_1.template_id, anon_1.page_id, anon_1. | +-----------+------+---------+--------------+--------------------+----------------------------------------------------+ 9 rows in set (0.004 sec)
The queries are getting killed when they reach max_statement_time (1 hour), and are logged in /srv/labsdb/data/tools-db-6-slow.log. I can see similar queries in the slow query log since last year (2025-11-18) so I'm not sure why the "Transaction History Length" has only started increasing now.





















