Page MenuHomePhabricator

archive_userindex view not updated to include ar_comment_id
Closed, ResolvedPublic

Description

archive_userindex table doesn't include ar_comment_id column which is in archive table:

MariaDB [enwiki_p]> describe archive_userindex;
+-------------------+---------------------+------+-----+---------+-------+
| Field             | Type                | Null | Key | Default | Extra |
+-------------------+---------------------+------+-----+---------+-------+
| ar_id             | int(10) unsigned    | NO   |     | 0       |       |
| ar_namespace      | int(11)             | NO   |     | 0       |       |
| ar_title          | varbinary(255)      | NO   |     |         |       |
| ar_text           | binary(0)           | YES  |     | NULL    |       |
| ar_comment        | binary(0)           | YES  |     | NULL    |       |      <------- ???
| ar_user           | int(5) unsigned     | NO   |     | 0       |       |
| ar_user_text      | varbinary(255)      | NO   |     |         |       |
...
+-------------------+---------------------+------+-----+---------+-------+
20 rows in set (0.00 sec)

MariaDB [enwiki_p]> describe archive;
+-------------------+---------------------+------+-----+---------+-------+
| Field             | Type                | Null | Key | Default | Extra |
+-------------------+---------------------+------+-----+---------+-------+
| ar_id             | int(10) unsigned    | NO   |     | 0       |       |
| ar_namespace      | int(11)             | NO   |     | 0       |       |
| ar_title          | varbinary(255)      | NO   |     |         |       |
| ar_text           | binary(0)           | YES  |     | NULL    |       |
| ar_comment        | binary(0)           | YES  |     | NULL    |       |
| ar_comment_id     | binary(0)           | YES  |     | NULL    |       |    <---------- is here
| ar_user           | bigint(10) unsigned | YES  |     | NULL    |       |
| ar_user_text      | varbinary(255)      | YES  |     | NULL    |       |
...
+-------------------+---------------------+------+-----+---------+-------+
21 rows in set (0.00 sec)

This is bad because it means you can't get edit summaries of deleted revisions out of archive_userindex which is helpful. It is also inconsistent with revision and revision_userindex which both have rev_comment_id columns.

Event Timeline

Sigma created this task.Dec 25 2018, 11:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 25 2018, 11:51 PM
Krenair renamed this task from Toolforge archive_userindex not updated to use new comment table to archive_userindex view not updated to include ar_comment_id.Dec 26 2018, 12:49 AM
Krenair removed Anomie as the assignee of this task.
Krenair edited projects, added Data-Services; removed Toolforge.
Krenair added a subscriber: Anomie.
Framawiki added a subscriber: Framawiki.
Lofhi awarded a token.Jan 9 2019, 4:32 PM
Lofhi added a subscriber: Lofhi.Jan 9 2019, 4:40 PM

This is quite annoying, because this missing column has already broken an external tool (Sigma's tool) on Toolforge, and the use of
archive_userindex is strongly recommended for WHERE clause or ORDER BY statement.
Several contributors from different communities (mainly frwiki and enwiki) reported that they are penalized in their daily contributions.

Anomie added a comment.Jan 9 2019, 6:14 PM

While this should be fixed for schema consistency, I note that

This is bad because it means you can't get edit summaries of deleted revisions out of archive_userindex

isn't going to be changed by fixing this. Edit summaries of deleted revisions aren't available in archive or archive_compat either, the fields are always NULL.

Change 488972 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] wiki replicas: Adding the ar_comment_id field to archive_userindex

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

Bstorm added a subscriber: Bstorm.Feb 7 2019, 5:48 PM

Again, this field is really just null on all views, but I'm adding it in there.

Change 488972 merged by Bstorm:
[operations/puppet@production] wiki replicas: Adding the ar_comment_id field to archive_userindex

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

Bstorm closed this task as Resolved.Feb 7 2019, 8:36 PM
Bstorm claimed this task.