Page MenuHomePhabricator

Maintenance script to regenerate revtag for list of pages
Open, MediumPublic

Description

Due to T364681: Issues with translatable pages on Wikidata due to revision id overflow...

populateFuzzy partially does this (for the fuzzy tags), but cannot accept a specific list of page/page id's, nor will it override any values that exist for that item.

It also doesn't fix any other tags.

Event Timeline

  • tp:mark is self-healing and should be okay as people mark pages for translation
  • tp:tag would require reparsing pages with broken revtag rows
  • tp:transver would require a complicated query to find what version of the source page existed when translation was made - not sure if worth the effort
  • tp:fuzzy could be updated with an improved script

Looking at the numbers in T364681#9812752 it seems we could just null-edit a couple of pages and see what we can do for the tp:transver.

MariaDB [wikidatawiki]> select rt_type, count(rt_type) from revtag where rt_revision = 2147483647 group by rt_type;
+-------------+----------------+
| rt_type     | count(rt_type) |
+-------------+----------------+
| fuzzy       |             15 |
| tp:mark     |              1 |
| tp:tag      |              2 |
| tp:transver |           1042 |
+-------------+----------------+
4 rows in set (0.002 sec)

The tp:tag ones look to have been fixed (I did some poking)

MariaDB [wikidatawiki]> select rt_type, count(rt_type) from revtag where rt_revision = 2147483647 group by rt_type;
+-------------+----------------+
| rt_type     | count(rt_type) |
+-------------+----------------+
| fuzzy       |             15 |
| tp:mark     |              1 |
| tp:transver |           1042 |
+-------------+----------------+
3 rows in set (0.070 sec)

tp:mark seems to be broken as per T365505: RuntimeException: Revision is null

For one row.. Do we just want to set the rt_revision manually?

MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_revision = 2147483647 and rt_type='tp:mark';
+----------------+-----------------+---------+----------+-------------+----------+
| page_namespace | page_title      | rt_type | rt_page  | rt_revision | rt_value |
+----------------+-----------------+---------+----------+-------------+----------+
|             12 | QuickStatements | tp:mark | 42892887 |  2147483647 | NULL     |
+----------------+-----------------+---------+----------+-------------+----------+
1 row in set (0.065 sec)
MariaDB [wikidatawiki]> select * from revision where rev_page=42892887 and rev_id >= 2147483647;
+------------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
| rev_id     | rev_page | rev_comment_id | rev_actor | rev_timestamp  | rev_minor_edit | rev_deleted | rev_len | rev_parent_id | rev_sha1                        |
+------------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
| 2148511880 | 42892887 |         340625 |   3013293 | 20240508100523 |              0 |           0 |   55255 |    2147457067 | 1ln7lp2n2jdxzf9izhvw63pb6xv776m |
| 2152902103 | 42892887 |      775139406 |        87 | 20240513060429 |              0 |           0 |   55387 |    2148511880 | 0enxyvwrjih1qouz0zji8e6p75kxhsz |
| 2154892554 | 42892887 |      775812716 |   1066407 | 20240515102558 |              0 |           0 |   55530 |    2152902103 | 9hu0ui18b68d51f0hdsct93zx3o3ekr |
| 2154896250 | 42892887 |      775814130 |   1066407 | 20240515103205 |              0 |           0 |   55654 |    2154892554 | lmmqrb4gv7eibadufl4narub01qm8v4 |
| 2160970245 | 42892887 |        1342444 |    177220 | 20240521165939 |              0 |           0 |   55677 |    2154896250 | 37hit4d2kbtqojg1dg6i19p90blcvrg |
| 2160970357 | 42892887 |      778539871 |    177220 | 20240521165953 |              0 |           0 |   55654 |    2160970245 | lmmqrb4gv7eibadufl4narub01qm8v4 |
+------------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
6 rows in set (0.042 sec)

According to the log (click on the Help:QuickStatements link), that rt_revision should be 2148511880. And yes, probably the easiest solution is to just directly modify the database and let translation admins review the changes that happened since then.

MariaDB [wikidatawiki]> select * from revtag where rt_page = 42892887;
+---------+----------+-------------+----------+
| rt_type | rt_page  | rt_revision | rt_value |
+---------+----------+-------------+----------+
| tp:mark | 42892887 |  2147483647 | NULL     |
| tp:tag  | 42892887 |  2160970357 | NULL     |
+---------+----------+-------------+----------+
2 rows in set (0.441 sec)

MariaDB [wikidatawiki]> UPDATE revtag SET rt_revision=2148511880 WHERE rt_page=42892887 and rt_type='tp:mark';
Query OK, 1 row affected (0.003 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wikidatawiki]> select * from revtag where rt_page = 42892887;
+---------+----------+-------------+----------+
| rt_type | rt_page  | rt_revision | rt_value |
+---------+----------+-------------+----------+
| tp:mark | 42892887 |  2148511880 | NULL     |
| tp:tag  | 42892887 |  2160970357 | NULL     |
+---------+----------+-------------+----------+
2 rows in set (0.270 sec)

MariaDB [wikidatawiki]>
MariaDB [wikidatawiki]> select rt_type, count(rt_type) from revtag where rt_revision = 2147483647 group by rt_type;
+-------------+----------------+
| rt_type     | count(rt_type) |
+-------------+----------------+
| fuzzy       |             15 |
| tp:transver |           1042 |
+-------------+----------------+
2 rows in set (0.003 sec)
MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_revision = 2147483647 and rt_type='fuzzy';
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
| page_namespace | page_title                                  | rt_type | rt_page   | rt_revision | rt_value |
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
|           1198 | Help:About_data/1/fi                        | fuzzy   |  22539216 |  2147483647 | NULL     |
|           1198 | Wikidata:WikiProject_Narration/16/id        | fuzzy   |  66144757 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/47/es                       | fuzzy   |  95353757 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/63/es                       | fuzzy   |  99955279 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/65/es                       | fuzzy   |  99955345 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/58/es                       | fuzzy   |  99955350 |  2147483647 | NULL     |
|           1198 | Wikidata:Main_Page/Get_involved/11/ps       | fuzzy   | 108691224 |  2147483647 | NULL     |
|           1198 | Wikidata:Main_Page/Contact/4/ps             | fuzzy   | 119969386 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/Leveling_Up_Days_2024/79/fr | fuzzy   | 120003086 |  2147483647 | NULL     |
|           1198 | Help:About_data/54/dtp                      | fuzzy   | 120022619 |  2147483647 | NULL     |
|           1198 | Help:About_data/50/dtp                      | fuzzy   | 120022680 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/57/fi                       | fuzzy   | 120029430 |  2147483647 | NULL     |
|           1198 | Wikidata:Community_portal/45/lt             | fuzzy   | 120044391 |  2147483647 | NULL     |
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
13 rows in set (0.004 sec)

Noting populateFuzzy.php does

				$dbw->replace( 'revtag', [ [ 'rt_type', 'rt_page', 'rt_revision' ] ], $inserts, __METHOD__ );

replace won't do actally anything helpful here. There's only 3 columns in the table, and we're updating them all. So if it matches the PK and exists, there's nothing to update. If there were other colums being updated, then fine, sure, it could be helpful.

It could/would theoretically insert another row, if there was data corruption like in this case, or there isn't one for that specific revision.

Change #1034606 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/Translate@master] populateFuzzy: Swap replace for insert

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

MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_type='fuzzy' and rt_page IN (22539216, 120022619, 120022680) and rt_revision=2147483647;
+----------------+------------------------+---------+-----------+-------------+----------+
| page_namespace | page_title             | rt_type | rt_page   | rt_revision | rt_value |
+----------------+------------------------+---------+-----------+-------------+----------+
|           1198 | Help:About_data/1/fi   | fuzzy   |  22539216 |  2147483647 | NULL     |
|           1198 | Help:About_data/54/dtp | fuzzy   | 120022619 |  2147483647 | NULL     |
|           1198 | Help:About_data/50/dtp | fuzzy   | 120022680 |  2147483647 | NULL     |
+----------------+------------------------+---------+-----------+-------------+----------+
3 rows in set (0.001 sec)

The first had a fuzzy because Niklas added it.. The other two didn't have a fuzzy in the text. One revision, only created a week ago...

Deleted the rows for ease, and low amount of rows.

Running populateFuzzy against the Help NS re-added it to the Finnish one. Not the two dtp ones.

MariaDB [wikidatawiki]> select * from revtag where rt_type='fuzzy' and rt_page IN (22539216, 120022619, 120022680);
+---------+----------+-------------+----------+
| rt_type | rt_page  | rt_revision | rt_value |
+---------+----------+-------------+----------+
| fuzzy   | 22539216 |   994879972 | NULL     |
| fuzzy   | 22539216 |  2155808841 | NULL     |
+---------+----------+-------------+----------+
2 rows in set (0.001 sec)

Is it worth just deleting the rest of the fuzzys in the Wikidata NS, and re-run the populateFuzzy script?

It has ~77K pages, so will be a bit slower than the Help NS.

MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_revision = 2147483647 and rt_type='fuzzy';
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
| page_namespace | page_title                                  | rt_type | rt_page   | rt_revision | rt_value |
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
|           1198 | Wikidata:WikiProject_Narration/16/id        | fuzzy   |  66144757 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/47/es                       | fuzzy   |  95353757 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/63/es                       | fuzzy   |  99955279 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/65/es                       | fuzzy   |  99955345 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/58/es                       | fuzzy   |  99955350 |  2147483647 | NULL     |
|           1198 | Wikidata:Main_Page/Get_involved/11/ps       | fuzzy   | 108691224 |  2147483647 | NULL     |
|           1198 | Wikidata:Main_Page/Contact/4/ps             | fuzzy   | 119969386 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/Leveling_Up_Days_2024/79/fr | fuzzy   | 120003086 |  2147483647 | NULL     |
|           1198 | Wikidata:Events/57/fi                       | fuzzy   | 120029430 |  2147483647 | NULL     |
|           1198 | Wikidata:Community_portal/45/lt             | fuzzy   | 120044391 |  2147483647 | NULL     |
+----------------+---------------------------------------------+---------+-----------+-------------+----------+
10 rows in set (0.021 sec)

All the Wikidata:Events tranlsations have fuzzy currently, the other 5 don't...

Is it worth just deleting the rest of the fuzzys in the Wikidata NS, and re-run the populateFuzzy script?

That would lose fuzzy on cases where fuzzy tags have been added programmatically, e.g. outdated page translation sections. populateFuzzy only adds fuzzy tags for messages with explicit fuzzy or validation issues.

I don’t mean all of them, I mean where the revision ID is the wrong one.

As if the rev ID is wrong, it’s not like it’s useful annotations…

That is fine. These all look like they have been manually fuzzied or failing validation.

Ok, done, and re-ran the populateFuzzy for the Wikidata (project) NS...

MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_page IN (66144757, 95353757, 99955279, 99955345, 99955350, 108691224, 119969386, 120003086, 120029430, 120044391) and rt_revision > 2147483647 and rt_type='fuzzy';
+----------------+-----------------------+---------+----------+-------------+----------+
| page_namespace | page_title            | rt_type | rt_page  | rt_revision | rt_value |
+----------------+-----------------------+---------+----------+-------------+----------+
|           1198 | Wikidata:Events/58/es | fuzzy   | 99955350 |  2160918731 | NULL     |
+----------------+-----------------------+---------+----------+-------------+----------+
1 row in set (0.004 sec)

And then for the translation NS, which is still running, it is repopulating (at least some of) the fuzzy

MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_page IN (66144757, 95353757, 99955279, 99955345, 99955350, 108691224, 119969386, 120003086, 120029430, 120044391) and rt_revision > 2147483647 and rt_type='fuzzy';
+----------------+-----------------------+---------+-----------+-------------+----------+
| page_namespace | page_title            | rt_type | rt_page   | rt_revision | rt_value |
+----------------+-----------------------+---------+-----------+-------------+----------+
|           1198 | Wikidata:Events/47/es | fuzzy   |  95353757 |  2151698459 | NULL     |
|           1198 | Wikidata:Events/63/es | fuzzy   |  99955279 |  2150727585 | NULL     |
|           1198 | Wikidata:Events/65/es | fuzzy   |  99955345 |  2152552151 | NULL     |
|           1198 | Wikidata:Events/58/es | fuzzy   |  99955350 |  2160918731 | NULL     |
|           1198 | Wikidata:Events/57/fi | fuzzy   | 120029430 |  2155806135 | NULL     |
+----------------+-----------------------+---------+-----------+-------------+----------+
5 rows in set (0.001 sec)
MariaDB [wikidatawiki]> select page_namespace, page_title, revtag.* from revtag INNER JOIN page ON (rt_page=page_id) where rt_page IN (66144757, 95353757, 99955279, 99955345, 99955350, 108691224, 119969386, 120003086, 120029430, 120044391, 22539216, 120022619, 120022680) and rt_revision > 2147483647 and rt_type='fuzzy';
+----------------+-----------------------+---------+-----------+-------------+----------+
| page_namespace | page_title            | rt_type | rt_page   | rt_revision | rt_value |
+----------------+-----------------------+---------+-----------+-------------+----------+
|           1198 | Help:About_data/1/fi  | fuzzy   |  22539216 |  2155808841 | NULL     |
|           1198 | Wikidata:Events/47/es | fuzzy   |  95353757 |  2151698459 | NULL     |
|           1198 | Wikidata:Events/63/es | fuzzy   |  99955279 |  2150727585 | NULL     |
|           1198 | Wikidata:Events/65/es | fuzzy   |  99955345 |  2152552151 | NULL     |
|           1198 | Wikidata:Events/58/es | fuzzy   |  99955350 |  2160918731 | NULL     |
|           1198 | Wikidata:Events/57/fi | fuzzy   | 120029430 |  2155806135 | NULL     |
+----------------+-----------------------+---------+-----------+-------------+----------+
6 rows in set (0.004 sec)
MariaDB [wikidatawiki]> select rt_type, count(rt_type) from revtag where rt_revision = 2147483647 group by rt_type;
+-------------+----------------+
| rt_type     | count(rt_type) |
+-------------+----------------+
| tp:transver |           1042 |
+-------------+----------------+
1 row in set (0.003 sec)

MariaDB [wikidatawiki]>

So very much the tp:transver left if we want to do anything...

(wikidatawiki)> SELECT      page_namespace,      page_title,       rt_revision,      rev_id  FROM      revtag  LEFT JOIN      page  ON      (page_id = rt_page)  JOIN      revision  ON      (page_id = rev_page AND rev_id >= rt_revision)  WHERE      rt_type = 'tp:transver' AND rt_revision = 2147483647;
...
1169 rows in set (0.205 sec)

Looks like for majority we can just pick up rev_id unambiguously, but there are some where it is ambiguous:

(wikidatawiki)> SELECT      page_namespace,      page_title,       count(*)  FROM      revtag  LEFT JOIN      page  ON      (page_id = rt_page)  JOIN      revision  ON      (page_id = rev_page AND rev_id >= rt_revision)  WHERE      rt_type = 'tp:transver' AND rt_revision = 2147483647 group by page_namespace, page_title having count(*) > 1;
+----------------+---------------------------------------------------------------------------------------------------------------+----------+
| page_namespace | page_title                                                                                                    | count(*) |
+----------------+---------------------------------------------------------------------------------------------------------------+----------+
|           1198 | Help:About_data/1/ar                                                                                          |        2 |
|           1198 | Help:Contents/1/pa                                                                                            |        2 |
|           1198 | Help:Contents/59/pa                                                                                           |        2 |
|           1198 | Help:Contents/65/pa                                                                                           |        2 |
|           1198 | Help:Contents/Page_display_title/id                                                                           |        2 |
|           1198 | Help:Contents/Page_display_title/pa                                                                           |        2 |
|           1198 | Help:FAQ/48/fi                                                                                                |        2 |
|           1198 | Help:Infobox_export_gadget/3/zh                                                                               |        3 |
|           1198 | Help:Infobox_export_gadget/8/zh                                                                               |        2 |
|           1198 | Help:Items/Page_display_title/ast                                                                             |        2 |
|           1198 | Help:Merge/95/vi                                                                                              |        2 |
|           1198 | Help:Navigating_Wikidata/User_Options/1/es                                                                    |        2 |
|           1198 | Help:Statements/3/fa                                                                                          |        2 |
|           1198 | Help:Usernames_and_accounts/Page_display_title/es                                                             |        2 |
|           1198 | MediaWiki:Gadget-MismatchFinder/2/fr                                                                          |        2 |
|           1198 | MediaWiki:Gadget-dark-mode/1/fr                                                                               |        2 |
|           1198 | Template:Edit_group_box/text/4/ja                                                                             |        2 |
|           1198 | Template:LC_zh/3/fr                                                                                           |        2 |
|           1198 | User:KrBot/11/fr                                                                                              |        2 |
|           1198 | Wikidata:Bot_requests/Header/14/ja                                                                            |        2 |
|           1198 | Wikidata:Community_portal/36/pa                                                                               |        2 |
|           1198 | Wikidata:Community_portal/45/lt                                                                               |        3 |
|           1198 | Wikidata:Community_portal/49/pa                                                                               |        2 |
|           1198 | Wikidata:Community_portal/Page_display_title/id                                                               |        2 |
|           1198 | Wikidata:Contribute/29/de-formal                                                                              |        2 |
|           1198 | Wikidata:Contribute/Page_display_title/da                                                                     |        2 |
|           1198 | Wikidata:Events/46/ar                                                                                         |        2 |
|           1198 | Wikidata:Events/46/dtp                                                                                        |        4 |
|           1198 | Wikidata:Events/46/id                                                                                         |        8 |
|           1198 | Wikidata:Events/46/nl                                                                                         |        3 |
|           1198 | Wikidata:Events/47/dtp                                                                                        |        4 |
|           1198 | Wikidata:Events/47/es                                                                                         |        4 |
|           1198 | Wikidata:Events/48/dtp                                                                                        |        2 |
|           1198 | Wikidata:Events/52/id                                                                                         |        4 |
|           1198 | Wikidata:Events/57/fi                                                                                         |        2 |
|           1198 | Wikidata:Events/58/es                                                                                         |        3 |
|           1198 | Wikidata:Events/59/ru                                                                                         |        2 |
|           1198 | Wikidata:Events/61/dtp                                                                                        |        3 |
|           1198 | Wikidata:Events/63/ca                                                                                         |        2 |
|           1198 | Wikidata:Events/63/es                                                                                         |        2 |
|           1198 | Wikidata:Events/63/id                                                                                         |        5 |
|           1198 | Wikidata:Events/65/es                                                                                         |        2 |
|           1198 | Wikidata:Events/67/fr                                                                                         |        2 |
|           1198 | Wikidata:Events/85/id                                                                                         |        2 |
|           1198 | Wikidata:Events/88/fr                                                                                         |        2 |
|           1198 | Wikidata:Events/91/id                                                                                         |        2 |
|           1198 | Wikidata:Events/93/fr                                                                                         |        2 |
|           1198 | Wikidata:Events/Leveling_Up_Days_2024/23/fr                                                                   |        2 |
|           1198 | Wikidata:Events/Leveling_Up_Days_2024/48/fr                                                                   |        2 |
|           1198 | Wikidata:Events/Page_display_title/ca                                                                         |        2 |
|           1198 | Wikidata:Events/Page_display_title/dtp                                                                        |        3 |
|           1198 | Wikidata:Events/Page_display_title/es                                                                         |        2 |
|           1198 | Wikidata:Events/Page_display_title/fr                                                                         |        4 |
|           1198 | Wikidata:Events/Page_display_title/id                                                                         |        6 |
|           1198 | Wikidata:Events/Page_display_title/ms                                                                         |        3 |
|           1198 | Wikidata:Events/Page_display_title/ms-arab                                                                    |        2 |
|           1198 | Wikidata:Events/Page_display_title/pl                                                                         |        2 |
|           1198 | Wikidata:Events/Page_display_title/sr                                                                         |        2 |
|           1198 | Wikidata:Incubator/12/fr                                                                                      |        2 |
|           1198 | Wikidata:Incubator/7/fr                                                                                       |        2 |
|           1198 | Wikidata:Incubator/8/fr                                                                                       |        2 |
|           1198 | Wikidata:Incubator/Page_display_title/fr                                                                      |        2 |
|           1198 | Wikidata:Introduction/10/id                                                                                   |        2 |
|           1198 | Wikidata:Introduction/4/nso                                                                                   |        2 |
|           1198 | Wikidata:Introduction/44/th                                                                                   |        3 |
|           1198 | Wikidata:Introduction/8/id                                                                                    |        2 |
|           1198 | Wikidata:Introduction/Page_display_title/dtp                                                                  |        2 |
|           1198 | Wikidata:Lexicographical_data/105/ms                                                                          |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/139/fr                                                            |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/48/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/51/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/71/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/72/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/73/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/74/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/75/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Documentation/76/fr                                                             |        2 |
|           1198 | Wikidata:Lexicographical_data/Glossary/13/ja                                                                  |        2 |
|           1198 | Wikidata:Lexicographical_data/Spelling_variant/Page_display_title/fr                                          |        2 |
|           1198 | Wikidata:MOOC/Course_outline/Définition_donnée_ouverte/23/nl                                                  |        2 |
|           1198 | Wikidata:MOOC/Course_outline/Définition_donnée_ouverte/24/nl                                                  |        2 |
|           1198 | Wikidata:MOOC/Course_outline/Définition_donnée_ouverte/37/nl                                                  |        2 |
|           1198 | Wikidata:MOOC/Course_outline/Définition_donnée_ouverte/6/nl                                                   |        2 |
|           1198 | Wikidata:Main_Page/Contact/2/dtp                                                                              |        3 |
|           1198 | Wikidata:Main_Page/Contact/4/ps                                                                               |        6 |
|           1198 | Wikidata:Main_Page/Get_involved/10/ar                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Get_involved/11/ar                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Get_involved/15/ar                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Get_involved/16/ar                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Get_involved/17/ar                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Get_involved/17/ps                                                                         |        3 |
|           1198 | Wikidata:Main_Page/Get_involved/18/ps                                                                         |        2 |
|           1198 | Wikidata:Main_Page/Sister_projects/26/id                                                                      |        2 |
|           1198 | Wikidata:Main_Page/Sister_projects/38/yo                                                                      |        2 |
|           1198 | Wikidata:Main_Page/Sister_projects/50/yo                                                                      |        2 |
|           1198 | Wikidata:Main_Page/Sister_projects/53/ps                                                                      |        2 |
|           1198 | Wikidata:Main_Page/Sister_projects/53/yo                                                                      |        2 |
|           1198 | Wikidata:Main_Page/Welcome/1/ar                                                                               |        2 |
|           1198 | Wikidata:Main_Page/Welcome/1/pt                                                                               |        2 |
|           1198 | Wikidata:Main_Page/Welcome/2/ar                                                                               |        2 |
|           1198 | Wikidata:Main_Page/Welcome/3/ar                                                                               |        3 |
|           1198 | Wikidata:Main_Page/Wikimedia/1/ps                                                                             |        3 |
|           1198 | Wikidata:Notability/35/fr                                                                                     |        2 |
|           1198 | Wikidata:Property_proposal/1/lb                                                                               |        2 |
|           1198 | Wikidata:Property_proposal/17/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/2/el                                                                               |        2 |
|           1198 | Wikidata:Property_proposal/28/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/29/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/32/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/35/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/37/lb                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/38/el                                                                              |        2 |
|           1198 | Wikidata:Property_proposal/38/lb                                                                              |        3 |
|           1198 | Wikidata:Requests_for_permissions/2/ar                                                                        |        2 |
|           1198 | Wikidata:Sitelinks_to_redirects/12/es                                                                         |        2 |
|           1198 | Wikidata:Sitelinks_to_redirects/16/es                                                                         |        2 |
|           1198 | Wikidata:Sitelinks_to_redirects/5/es                                                                          |        2 |
|           1198 | Wikidata:Sitelinks_to_redirects/8/es                                                                          |        2 |
|           1198 | Wikidata:Statistics/4/fr                                                                                      |        2 |
|           1198 | Wikidata:Status_updates/2024_02_12/11/nl                                                                      |        2 |
|           1198 | Wikidata:Status_updates/2024_02_12/2/nl                                                                       |        2 |
|           1198 | Wikidata:Status_updates/2024_02_12/4/nl                                                                       |        4 |
|           1198 | Wikidata:Status_updates/2024_02_12/7/nl                                                                       |        4 |
|           1198 | Wikidata:Status_updates/2024_02_12/9/nl                                                                       |        2 |
|           1198 | Wikidata:Tenth_Birthday/Run_an_event/Funding/43/fr                                                            |        2 |
|           1198 | Wikidata:Tenth_Birthday/Tyap_Wikimedians_User_Group_Celebrates_Wikidata's_10th_Birthday/Page_display_title/fr |        2 |
|           1198 | Wikidata:Tools/175/sr                                                                                         |        2 |
|           1198 | Wikidata:Tools/Enhance_user_interface/Page_display_title/ta                                                   |        2 |
|           1198 | Wikidata:Tools/Lexicographical_data/32/ja                                                                     |        2 |
|           1198 | Wikidata:Training/10/fr                                                                                       |        3 |
|           1198 | Wikidata:Vandalism/1/de                                                                                       |        2 |
|           1198 | Wikidata:Vandalism/2/de                                                                                       |        2 |
|           1198 | Wikidata:Vandalism/5/de                                                                                       |        2 |
|           1198 | Wikidata:Vandalism/6/de                                                                                       |        2 |
|           1198 | Wikidata:Wikibase/1/id                                                                                        |        2 |
|           1198 | Wikidata:Wikibase/2/id                                                                                        |        2 |
+----------------+---------------------------------------------------------------------------------------------------------------+----------+
136 rows in set (0.025 sec)

In my reading of the code, we use replace() to add tp:transver on save. In this case I think the latest edit (only place where this info is relevant anyway) will overwrite previous values with the bad revision id. So basically I think we can just update the bad rt_revision to page_latest of the relevant page (ignoring and dropping the bad row if there is already such a row present)

UPDATE revtag JOIN page ON (rt_page=page_id) SET rt_revision = page_latest where rt_revision = 2147483647 AND rt_page NOT IN (SELECT page_id FROM revtag LEFT JOIN page ON (page_id = rt_page) JOIN revision ON (page_id = rev_page AND rev_id >= rt_revision) WHERE rt_type = 'tp:transver' AND rt_revision = 2147483647 group by page_namespace, page_title having count(*) > 1);

I think this will take case of most of those rows then (very lazily cobbled together SQL queries)...

Change #1034606 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] populateFuzzy: Swap replace for insert

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