Page MenuHomePhabricator

Convert unique keys into primary keys for some wiki tables on s6-eqiad and codfw
Closed, ResolvedPublic

Description

alter table templatelinks add primary key (tl_from,tl_namespace,tl_title); -- duplicate index, to be fixed on mediawiki later
alter table pagelinks add primary key (pl_from,pl_namespace,pl_title); -- duplicate index, to be fixed on mediawiki later
alter table categorylinks drop key cl_from, add primary key (cl_from,cl_to);
alter table imagelinks drop key il_from, add primary key (il_from,il_to);
alter table iwlinks drop key iwl_from, add primary key (iwl_from,iwl_prefix,iwl_title);
alter table langlinks drop key ll_from, add primary key (ll_from,ll_lang);
alter table log_search drop key ls_field_val, add primary key (ls_field,ls_value,ls_log_id);
alter table math drop key math_inputhash, add primary key (math_inputhash);
alter table module_deps drop key md_module_skin, add primary key (md_module,md_skin);
alter table objectcache drop key keyname, add primary key (keyname);
alter table querycache_info drop key  qci_type, add primary key (qci_type);
alter table site_stats drop key ss_row_id, add primary key (ss_row_id);
alter table text drop key old_id, add primary key (old_id);
alter table transcache drop key tc_url_idx, add primary key (tc_url);
alter table user_former_groups drop key ufg_user_group, add primary key (ufg_user,ufg_group);
alter table user_properties drop key user_properties_user_property, add primary key (up_user,up_property);

DCs done:

  • eqiad
  • codfw

Event Timeline

jcrespo created this task.Apr 27 2017, 8:49 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 27 2017, 8:49 AM

Mentioned in SAL (#wikimedia-operations) [2017-04-27T08:55:09Z] <jynus> deploying alter table to all wikis on s6 T163979

jcrespo moved this task from Triage to In progress on the DBA board.Apr 27 2017, 9:38 AM
jcrespo closed this task as Resolved.Apr 28 2017, 10:20 AM

This is now done, no errors, no replication lag (only db1093 was skipped some events as it as already deployed there).

jcrespo renamed this task from Convert unique keys into primary keys for some wiki tables on s6 to Convert unique keys into primary keys for some wiki tables on s6-eqiad.May 1 2017, 11:15 AM
Marostegui reopened this task as Open.Sep 26 2017, 1:23 PM
Marostegui claimed this task.

Re-opening to make sure codfw also get the PKs as they are missing there.
I will directly alter the master as replication to eqiad is disconnected

root@db2028.codfw.wmnet[(none)]> show slave hosts;
+-----------+------+------+-----------+
| Server_id | Host | Port | Master_id |
+-----------+------+------+-----------+
| 180367365 |      | 3306 | 180359184 |
| 180355104 |      | 3316 | 180359184 |
| 180359206 |      | 3306 | 180359184 |
| 180363274 |      | 3306 | 180359184 |
| 180363370 |      | 3306 | 180359184 |
| 180367372 |      | 3306 | 180359184 |
| 180367379 |      | 3306 | 180359184 |
+-----------+------+------+-----------+
7 rows in set (0.04 sec)
root@db1061[(none)]> select @@hostname;
+------------+
| @@hostname |
+------------+
| db1061     |
+------------+
1 row in set (0.00 sec)

root@db1061[(none)]> show slave status;
Empty set (0.00 sec)
Marostegui renamed this task from Convert unique keys into primary keys for some wiki tables on s6-eqiad to Convert unique keys into primary keys for some wiki tables on s6-eqiad and codfw.Sep 26 2017, 1:24 PM
Marostegui updated the task description. (Show Details)

Mentioned in SAL (#wikimedia-operations) [2017-09-26T13:39:16Z] <marostegui> Deploy alter table on s6 master (with replication enable, so lag will be generated) db2028 - T163979

codfw is finished

Marostegui closed this task as Resolved.Sep 27 2017, 6:46 AM
Marostegui updated the task description. (Show Details)