Page MenuHomePhabricator

pl_namespace index on pagelinks is unique only in s8
Closed, ResolvedPublic

Description

Similar to T250060: tl_namespace index on templatelinks is unique only in s8:

    "pagelinks pl_namespace index-uniqueness-mismatch": {
	        "s8": [
	            "db1109.eqiad.wmnet",
	            "db1087.eqiad.wmnet",
	            "db1099.eqiad.wmnet",
	            "db1111.eqiad.wmnet",
	            "db1092.eqiad.wmnet",
	            "db1101.eqiad.wmnet",
	            "db1104.eqiad.wmnet",
	            "db1114.eqiad.wmnet",
	            "db1126.eqiad.wmnet"
	        ]
	    },

ALTER neeed:

ALTER TABLE pagelinks DROP KEY pl_namespace, add KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`);

Progress

Event Timeline

Marostegui moved this task from Triage to Backlog on the DBA board.
Marostegui moved this task from Backlog to In progress on the DBA board.

This is how the table looks like after the change on dbstore1005:3318

root@cumin1001:/home/marostegui# mysql.py -hdbstore1005:3318 -e "show create table wikidatawiki.pagelinks\G"
*************************** 1. row ***************************
       Table: pagelinks
Create Table: CREATE TABLE `pagelinks` (
  `pl_from` int(10) 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_backlinks_namespace` (`pl_from_namespace`,`pl_namespace`,`pl_title`,`pl_from`),
  KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8

Which is exactly how it looks like on enwiki:

root@cumin1001:/home/marostegui# mysql.py -h db1089 -e "show create table enwiki.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

This alter takes around 3h, so let's try to get it done before the switchover, so we can take advantage of eqiad being standby and alter the eqiad master without much risks

s8 eqiad progress

  • labsdb1012
  • labsdb1011
  • labsdb1010
  • labsdb1009
  • dbstore1005
  • db1126
  • db1124
  • db1116
  • db1114
  • db1111
  • db1109
  • db1104
  • db1101
  • db1099
  • db1092
  • db1087

Mentioned in SAL (#wikimedia-operations) [2020-07-15T09:47:59Z] <marostegui> Deploy schema change on s8 codfw master, lag will appear on codfw T256685

Mentioned in SAL (#wikimedia-operations) [2020-07-21T07:48:44Z] <marostegui@cumin1001> dbctl commit (dc=all): 'Depool db1087 T256685', diff saved to https://phabricator.wikimedia.org/P11978 and previous config saved to /var/cache/conftool/dbconfig/20200721-074843-marostegui.json

Mentioned in SAL (#wikimedia-operations) [2020-07-21T07:49:45Z] <marostegui> Deploy schema change on db1087, lag will appear on s8 (wikidata) on labsdb hosts T256685

Marostegui changed the task status from Open to Stalled.Jul 22 2020, 8:15 AM
Marostegui moved this task from In progress to Blocked external/Not db team on the DBA board.

Only the master pending - stalling this until the DC switchover is done and eqiad is stand by.

Marostegui changed the task status from Stalled to Open.Sep 7 2020, 4:43 AM
Marostegui moved this task from Blocked external/Not db team to In progress on the DBA board.

Mentioned in SAL (#wikimedia-operations) [2020-09-07T04:53:02Z] <marostegui> Deploy schema change on db1109 (eqiad wikidata master) - T256685

The master is done:

# mysql.py -hdb1109 wikidatawiki -e "show create table pagelinks\G"
*************************** 1. row ***************************
       Table: pagelinks
Create Table: CREATE TABLE `pagelinks` (
  `pl_from` int(10) 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_backlinks_namespace` (`pl_from_namespace`,`pl_namespace`,`pl_title`,`pl_from`),
  KEY `pl_namespace` (`pl_namespace`,`pl_title`,`pl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
Marostegui updated the task description. (Show Details)