Page MenuHomePhabricator

REST API serving content of current revision for old revisions
Closed, ResolvedPublic

Description

REST API is serving content of current revision for old revisions. This affects at least visual editor and visual diffs.

For example: https://en.wikipedia.org/api/rest_v1/page/html/The_Fighting_Temeraire/1123182247 is identical to https://en.wikipedia.org/api/rest_v1/page/html/The_Fighting_Temeraire/1123185682.
1123182247 should contain the phrase "The painting currently hangs"; 1123185682 should contain the phrase "The painting hangs".

I originally noticed this because visual diffs were all showing "No changes", e.g.
https://en.wikipedia.org/w/index.php?title=The_Fighting_Temeraire&diff=1123185682&oldid=1123182247&diffmode=visual&visualdiff=1&diffonly=1

Event Timeline

matmarex triaged this task as Unbreak Now! priority.Dec 8 2022, 11:30 PM

Seems bad.

Most likely we should roll back the train, as this is probably related to either (a) the latest parsoid version on the train (unlikely) or (b) some change to the REST api exported by code for Parsoid (more likely).

Likely culprits:

$ git log --oneline origin/wmf/1.40.0-wmf.12...origin/wmf/1.40.0-wmf.13 -- includes/Rest
5a64f38dfe1 Merge "[Fix] ParsoidHandler: use HtmlOutputRendererHelper in wt2html"
cca97bcad7d Merge "[Re-apply] ParsoidHandler: use HtmlOutputRendererHelper in wt2html"
f36a28ff219 [Fix] ParsoidHandler: use HtmlOutputRendererHelper in wt2html
5cb388455b8 [Re-apply] ParsoidHandler: use HtmlOutputRendererHelper in wt2html
4380291b402 Merge "Fix casing of class and function name usages"
0cb2c3c1063 Fix casing of class and function name usages
fb5c29e2c04 Follow redirects for page/{title} formats source/bare
ab6baad1a5b Revert "ParsoidHandler: use HtmlOutputRendererHelper in wt2html"
e82f11c2466 ParsoidHandler: use HtmlOutputRendererHelper in wt2html

https://wikitech.wikimedia.org/wiki/Server_Admin_Log mentions some renames of restbase* hosts to cassandra* today, but I wouldn't suspect that to be a likely cause. That *should* affect only beta?

Notably, VE doesn't use this "old ID" path, so it's quite possible that's why this wasn't caught earlier during the train.

!log cwhite@deploy1002 rebuilt and synchronized wikiversions files: Revert "group2 wikis to 1.40.0-wmf.13"

Change 866525 had a related patch set uploaded (by Cwhite; author: Cole White):

[operations/mediawiki-config@master] Revert "group2 wikis to 1.40.0-wmf.13"

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

Change 866525 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert "group2 wikis to 1.40.0-wmf.13"

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

I started an incident report: https://wikitech.wikimedia.org/wiki/Incidents/2022-12-09_MediaWiki_REST_API - will leave it to others to fill up and follow-up on the rest :)

Change 866527 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/core@master] Followup to 5cb38845: Don't drop revid info

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

Change 866527 merged by jenkins-bot:

[mediawiki/core@master] Followup to 5cb38845: Don't drop revid info

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

Change 866472 had a related patch set uploaded (by Ladsgroup; author: Subramanya Sastry):

[mediawiki/core@wmf/1.40.0-wmf.13] Followup to 5cb38845: Don't drop revid info

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

Change 866472 merged by jenkins-bot:

[mediawiki/core@wmf/1.40.0-wmf.13] Followup to 5cb38845: Don't drop revid info

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

Mentioned in SAL (#wikimedia-operations) [2022-12-09T10:49:22Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:866472|Followup to 5cb38845: Don't drop revid info (T324801)]]

Mentioned in SAL (#wikimedia-operations) [2022-12-09T10:51:16Z] <ladsgroup@deploy1002> ladsgroup and ladsgroup: Backport for [[gerrit:866472|Followup to 5cb38845: Don't drop revid info (T324801)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet

I can't say for sure that this fixes the issue, I tried it on itwiki (which is on wmf.13) and it doesn't look fixed in mwdebug:

It can be due to some aggressive caching somewhere though. I tried adding random stuff to url to pass edge caching.

Mentioned in SAL (#wikimedia-operations) [2022-12-09T11:02:21Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:866472|Followup to 5cb38845: Don't drop revid info (T324801)]] (duration: 12m 59s)

Ladsgroup assigned this task to ssastry.

I can't say for sure that this fixes the issue, I tried it on itwiki (which is on wmf.13) and it doesn't look fixed in mwdebug:

It can be due to some aggressive caching somewhere though. I tried adding random stuff to url to pass edge caching.

nope, it was some sort of caching, fixed now: https://it.wikipedia.org/api/rest_v1/page/html/Alan_Turing/130330525?fwe

Change 866621 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] ParsoidHandler: test wt2html with old revision

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

Change 866622 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/services/parsoid@master] Mocha test for fetching old revision content

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

Change 866621 merged by jenkins-bot:

[mediawiki/core@master] ParsoidHandler: test wt2html with old revision

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

Change 866622 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Mocha test for fetching old revision content

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

Change 877256 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump parsoid to 0.17.0-a10

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

Change 877256 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.17.0-a10

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