Page MenuHomePhabricator

page_lang column of the page table is not replicated to Labs
Closed, ResolvedPublic

Description

This is a new column that was added in T69223: Schema change for page content language. But it's not available on the Tool Labs replicas:

MariaDB [metawiki_p]> select page_lang from page where page_lang is not null;
ERROR 1054 (42S22): Unknown column 'page_lang' in 'field list'

Event Timeline

TTO created this task.Dec 31 2016, 11:38 AM
Restricted Application added a project: Cloud-Services. · View Herald TranscriptDec 31 2016, 11:38 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This is listed as a fullview in maintain-replicas config. I guess we just need to run the script to recreate it and mysql will see the new field... @chasemp?

AlexMonk-WMF added a comment.EditedDec 31 2016, 3:53 PM

Nope, it's actually missing from most of the underlying databases.

Here are the views that have page.page_lang, so presumably it exists in the actual DBs too:

MariaDB [enwiki_p]> select table_schema from information_schema.columns where table_name = 'page' and column_name = 'page_lang';
+---------------------+
| table_schema        |
+---------------------+
| adywiki_p           |
| azbwiki_p           |
| cawikimedia_p       |
| cnwikimedia_p       |
| fawikivoyage_p      |
| fiwikivoyage_p      |
| gomwiki_p           |
| jamwiki_p           |
| lrcwiki_p           |
| maiwiki_p           |
| olowiki_p           |
| orwikisource_p      |
| tcywiki_p           |
| wikimania2016wiki_p |
| wikimania2017wiki_p |
+---------------------+
15 rows in set (1.44 sec)

So it looks like all the relatively new databases have it.

If I understand correctly this is not entirely a view issue but once it's fixed and replicated we still need to run maintain-views to establish them for the rest of the underlying databases.

The column is on all wikis, except on labsdb1001:enwiki, where it cannot be added, and will never be.

TTO added a comment.Mar 3 2017, 11:21 AM

This column remains unavailable from Labs. For another similar task (T155605) @jcrespo suggested modifying maintain-views.yaml in puppet, but this file lists both page and user_groups as 1:1 replicas, so there is nothing to change.

Perhaps maintain-views.py simply needs to be run? Is this @chasemp's territory?

The column is available in labs, what is not available is the view indeed.

mysql:root@localhost [enwiki]> select @@hostname;
+------------+
| @@hostname |
+------------+
| labsdb1009 |
+------------+
1 row in set (0.00 sec)

mysql:root@localhost [enwiki]> show create table user_groups\G
*************************** 1. row ***************************
       Table: user_groups
Create Table: CREATE TABLE `user_groups` (
  `ug_user` int(5) unsigned NOT NULL DEFAULT '0',
  `ug_group` varbinary(255) NOT NULL DEFAULT '',
  `ug_expiry` varbinary(14) DEFAULT NULL,
  PRIMARY KEY (`ug_user`,`ug_group`),
  KEY `ug_group` (`ug_group`),
  KEY `ug_expiry` (`ug_expiry`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8

We need to re-run the script so the view is dropped and recreated so it will include the new column, right @chasemp?

TTO assigned this task to chasemp.Mar 13 2017, 4:09 AM
chasemp reassigned this task from chasemp to TTO.Mar 14 2017, 2:49 PM

As far as I know this is all deployed as intended now, please validate.

TTO added a comment.Mar 14 2017, 8:24 PM

metawiki_p.page now contains the page_lang column; however, user_groups view still dos not contain the ug_expiry column. Shall I open a new task for that?

metawiki_p.page now contains the page_lang column; however, user_groups view still dos not contain the ug_expiry column. Shall I open a new task for that?

I don't mind lumping it in here but it wasn't clear to me that was part of this work from the description. Could you amend?

TTO added a comment.Mar 16 2017, 7:54 PM

I reckon we'd better keep @Aklapper happy and open a new task for the new issue :)

jcrespo closed this task as Resolved.Mar 22 2017, 8:05 PM