Page MenuHomePhabricator

dewiki_p: Error: 1712 - Index pagelinks is corrupted
Closed, ResolvedPublic

Description

Some queries just say "Index pagelinks is corrupted" in dewiki_p database

tools.persondata@tools-sgebastion-08:~$ sql de
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4590545
Server version: 10.4.19-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [dewiki_p]> SELECT DISTINCT page_id, page_title, pl_title FROM pagelinks, page WHERE page_id = pl_from AND pl_from_namespace IN (0, 10) AND pl_namespace = 0 limit 2;
ERROR 1712 (HY000): Index pagelinks is corrupted
MariaDB [dewiki_p]>

whereas:

tools.persondata@tools-sgebastion-08:~/bot$ sql --cluster web de
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 80817757
Server version: 10.4.19-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [dewiki_p]> SELECT DISTINCT page_id, page_title, pl_title FROM pagelinks, page WHERE page_id = pl_from AND pl_from_namespace IN (0, 10) AND pl_namespace = 0 limit 2;
+---------+------------+--------------------------+
| page_id | page_title | pl_title                 |
+---------+------------+--------------------------+
|  165242 | !          | Ausrufezeichen           |
| 7745134 | !!         | Doppeltes_Ausrufezeichen |
+---------+------------+--------------------------+
2 rows in set (0.00 sec)

Event Timeline

This is happening on clouddb1020 only indeed:

root@clouddb1020.eqiad.wmnet[dewiki]> check table pagelinks;
+------------------+-------+----------+-------------------------------------------------------------+
| Table            | Op    | Msg_type | Msg_text                                                    |
+------------------+-------+----------+-------------------------------------------------------------+
| dewiki.pagelinks | check | Warning  | InnoDB: Index pl_backlinks_namespace is marked as corrupted |
| dewiki.pagelinks | check | error    | Corrupt                                                     |
+------------------+-------+----------+-------------------------------------------------------------+
2 rows in set (7 min 32.179 sec)

Going to depool this host and re-do the index.

Change 732251 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] dbproxy1018: Depool clouddb1018

https://gerrit.wikimedia.org/r/732251

Change 732251 merged by Marostegui:

[operations/puppet@production] dbproxy1018: Depool clouddb1020

https://gerrit.wikimedia.org/r/732251

Interestingly dropping and creating the index on the same transaction didn't fix the issue, but doing it on separate transactions+analyzing the table fix it

root@clouddb1020.eqiad.wmnet[dewiki]> SELECT DISTINCT page_id, page_title, pl_title FROM pagelinks, page WHERE page_id = pl_from AND pl_from_namespace IN (0, 10) AND pl_namespace = 0 limit 2;
+---------+------------+--------------------------+
| page_id | page_title | pl_title                 |
+---------+------------+--------------------------+
|  165242 | !          | Ausrufezeichen           |
| 7745134 | !!         | Doppeltes_Ausrufezeichen |
+---------+------------+--------------------------+
2 rows in set (0.001 sec)

root@clouddb1020.eqiad.wmnet[dewiki]> use dewiki_p
Database changed
root@clouddb1020.eqiad.wmnet[dewiki_p]> SELECT DISTINCT page_id, page_title, pl_title FROM pagelinks, page WHERE page_id = pl_from AND pl_from_namespace IN (0, 10) AND pl_namespace = 0 limit 2;
+---------+------------+--------------------------+
| page_id | page_title | pl_title                 |
+---------+------------+--------------------------+
|  165242 | !          | Ausrufezeichen           |
| 7745134 | !!         | Doppeltes_Ausrufezeichen |
+---------+------------+--------------------------+
2 rows in set (0.002 sec)

root@clouddb1020.eqiad.wmnet[dewiki_p]> show create table dewiki.pagelinks\G
*************************** 1. row ***************************
       Table: pagelinks
Create Table: CREATE TABLE `pagelinks` (
  `pl_from` int(8) unsigned NOT NULL DEFAULT 0,
  `pl_namespace` int(11) NOT NULL DEFAULT 0,
  `pl_title` varbinary(255) NOT NULL DEFAULT '',
  `pl_from_namespace` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`pl_from`,`pl_namespace`,`pl_title`),
  KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`),
  KEY `pl_backlinks_namespace` (`pl_from_namespace`,`pl_namespace`,`pl_title`,`pl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
1 row in set (0.001 sec)

Host repooled, closing this.
Thanks for the report!