Page MenuHomePhabricator

s2 on db1069 stuck on a query for trwiki flaggedrevs_tracking table
Closed, ResolvedPublic

Description

Creating this for the record or future issues:

db1069 s2 instance was stuck for 10 hours on this query:

DELETE /* FlaggedRevs::clearStableOnlyDeps  */ FROM `flaggedrevs_tracking` WHERE ftr_from = '0'

It wasn't doing anything:

MariaDB SANITARIUM localhost trwiki > select * from flaggedrevs_tracking WHERE ftr_from = '0';
Empty set (0.01 sec)
MariaDB SANITARIUM localhost trwiki > explain DELETE /* FlaggedRevs::clearStableOnlyDeps  */ FROM `flaggedrevs_tracking` WHERE ftr_from = '0';
+------+-------------+----------------------+-------+----------------------+----------------------+---------+------+------+-------------+
| id   | select_type | table                | type  | possible_keys        | key                  | key_len | ref  | rows | Extra       |
+------+-------------+----------------------+-------+----------------------+----------------------+---------+------+------+-------------+
|    1 | SIMPLE      | flaggedrevs_tracking | range | from_namespace_title | from_namespace_title | 4       | NULL |    1 | Using where |
+------+-------------+----------------------+-------+----------------------+----------------------+---------+------+------+-------------+
1 row in set (0.01 sec)

It was impossible to even stop the slave, the server was stuck.
I killed it and before starting the replication ran an analyze table:

MariaDB SANITARIUM localhost (none) > analyze table trwiki.flaggedrevs_tracking;
+-----------------------------+---------+----------+----------+
| Table                       | Op      | Msg_type | Msg_text |
+-----------------------------+---------+----------+----------+
| trwiki.flaggedrevs_tracking | analyze | status   | OK       |
+-----------------------------+---------+----------+----------+
1 row in set (0.12 sec)

Started replication and again the same issue. Killed the server again
Converted the table to InnoDB and replication went thru without any issues

MariaDB SANITARIUM localhost trwiki > alter table flaggedrevs_tracking engine=innodb;
Query OK, 20490 rows affected (0.39 sec)
Records: 20490  Duplicates: 0  Warnings: 0