Page MenuHomePhabricator

Schema drift between Beta Cluster and Jade repo
Closed, ResolvedPublic

Description

The tables in the database has changed (according the git blame) and now have more columns and indexes while since they are wired into update.php through patching of existing tables, the beta cluster has completely different schema than the one in the code

Details

Event Timeline

MariaDB [enwiki]> explain jade_diff_judgment;
+----------------+------------------+------+-----+---------+----------------+
| Field          | Type             | Null | Key | Default | Extra          |
+----------------+------------------+------+-----+---------+----------------+
| jaded_id       | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| jaded_revision | int(10) unsigned | NO   | MUL | NULL    |                |
| jaded_judgment | int(10) unsigned | NO   |     | NULL    |                |
+----------------+------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

MariaDB [enwiki]> show indexes from jade_diff_judgment;
+--------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table              | Non_unique | Key_name                | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| jade_diff_judgment |          0 | PRIMARY                 |            1 | jaded_id       | A         |           1 |     NULL | NULL   |      | BTREE      |         |               |
| jade_diff_judgment |          0 | jaded_revision_judgment |            1 | jaded_revision | A         |           1 |     NULL | NULL   |      | BTREE      |         |               |
| jade_diff_judgment |          0 | jaded_revision_judgment |            2 | jaded_judgment | A         |           1 |     NULL | NULL   |      | BTREE      |         |               |
+--------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.00 sec)

MariaDB [enwiki]> explain jade_revision_judgment;
+----------------+------------------+------+-----+---------+----------------+
| Field          | Type             | Null | Key | Default | Extra          |
+----------------+------------------+------+-----+---------+----------------+
| jader_id       | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| jader_revision | int(10) unsigned | NO   | MUL | NULL    |                |
| jader_judgment | int(10) unsigned | NO   |     | NULL    |                |
+----------------+------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

MariaDB [enwiki]> show indexes from jade_revision_judgment;
+------------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table                  | Non_unique | Key_name                | Seq_in_index | Column_name    | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| jade_revision_judgment |          0 | PRIMARY                 |            1 | jader_id       | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| jade_revision_judgment |          0 | jader_revision_judgment |            1 | jader_revision | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| jade_revision_judgment |          0 | jader_revision_judgment |            2 | jader_judgment | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+------------------------+------------+-------------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.00 sec)

Basically, the problem is no one added incremental patch files. Just added more columns and indexes

Change 511080 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/Jade@master] Add missing schema change update patches

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

Change 511080 merged by jenkins-bot:
[mediawiki/extensions/Jade@master] Add missing schema change update patches

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

Halfak claimed this task.
Halfak subscribed.

Thank you for taking this on @Reedy. We'll be working with these tables again soon but they fell off of our radar for a little while. It looks like this is now resolved.