Last modified: 2014-04-25 06:14:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54200, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52200 - [Regression] Redirects on file repository no longer work on local wiki
[Regression] Redirects on file repository no longer work on local wiki
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.22.0
All All
: High major (vote)
: 1.22.0 release
Assigned To: Nobody - You can work on this!
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-28 19:25 UTC by Krinkle
Modified: 2014-04-25 06:14 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
aklapper: Backport_WMF-


Attachments

Description Krinkle 2013-07-28 19:25:44 UTC
[[commons:File:MaintenanceShell-Screenshot.png]] is a redirect to
[[commons:File:MaintenanceShell-v0.4.0-screenshot.png]].

* https://www.mediawiki.org/wiki/Extension:MaintenanceShell
  Uses the redirect as file embed, but renders as a red linked "220px" to local
  mediawiki.org Special:Upload.

* https://en.wikipedia.org/wiki/Special:GlobalUsage/MaintenanceShell-Screenshot.png

  Shows local usage on mediawiki.org.... but not because it is used but
  because local redlinks for file embeds always propagate to globalusage.

* https://en.wikipedia.org/wiki/File:MaintenanceShell-Screenshot.png

  Shows a regular file doesn't exist page.

* https://commons.wikimedia.org/wiki/File:MaintenanceShell-Screenshot.png

  Shows the file, with "redirect from".
Comment 1 Bawolff (Brian Wolff) 2013-07-28 19:50:37 UTC
Hmm. The file on commons isn't supressing the "no file by this name text". Its almost as if its being treated as a normal redirect instead of a file redirect.
Comment 2 Greg Grossmeier 2013-07-29 19:37:34 UTC
Confirming request for backport_to_WMF on this as it is pretty high priority. Let's try to get this done before the end of the week so we don't run into Wikimania mania.
Comment 3 Bawolff (Brian Wolff) 2013-07-29 19:47:42 UTC
(In reply to comment #2)
> Confirming request for backport_to_WMF on this as it is pretty high priority.
> Let's try to get this done before the end of the week so we don't run into
> Wikimania mania.

Note, this appears to be an isolated incident. Most file redirects still appear to work.
----

Additionally, it appears some sort of cache expired, and the example above is no longer broken.
Comment 4 Greg Grossmeier 2013-07-29 19:49:23 UTC
Oh.... well then.... cleared the request. :)
Comment 5 Bawolff (Brian Wolff) 2013-07-29 20:35:52 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Confirming request for backport_to_WMF on this as it is pretty high priority.
> > Let's try to get this done before the end of the week so we don't run into
> > Wikimania mania.
> 
> Note, this appears to be an isolated incident. Most file redirects still
> appear
> to work.

Meh, appears to be common on newer redirects (example: https://commons.wikimedia.org/w/index.php?title=File:Baku9.jpg&redirect=no ). Some sort of cache isn't being purged properly.
Comment 6 Bawolff (Brian Wolff) 2013-07-29 21:03:14 UTC
Current suspicion: File objects get cached in memcached. Perhaps when moving file, file isn't cleared from memcached. Person goes to view redirect, various code loads the file from cache. However the file object loaded from cached is the one that used to be associated with this title, but isn't anymore. Thus $file->getRedirected() returns false, because its still the old version of the file before it was a redirect. Eventually file falls out of memcached, and everything works.

(I haven't tested this theory yet. may be wrong).
Comment 7 Brad Jorsch 2013-07-29 21:36:21 UTC
I took a few minutes to do some debugging on this. It appears that the problem is that a memc key is being set in LocalRepo::checkRedirect() with an expiry of 86400s. This key is supposed to be invalidated by a call to LocalRepo::invalidateImageRedirect() when necessary, but apparently that is getting missed somehow.
Comment 8 Bawolff (Brian Wolff) 2013-08-04 02:03:23 UTC
Perhaps a more robust thing to do, would be instead of clearing that key, explicitly populate it on page move. That way, it shouldn't fallback to reading the (lagged) slave.

Interestingly enough, problem is not reproducible on test.wikipedia.org. ( https://test.wikipedia.org/w/index.php?title=File:Ex_1%25_ample.jpg&redirect=no ). I wonder if possibly there's some anti-vandalism bot that auto-loads pages on edit at commons, which is causing the cache to be repopulated in a different request before the change replicates to the slave db. (That theory might be stretching it though).
Comment 9 Bawolff (Brian Wolff) 2013-08-04 02:12:00 UTC
Also does not appear to happen on enwikipedia either ( example: https://en.wikipedia.org/w/index.php?title=File:ALANIS-FOE-FINAL-COVER.JPG&redirect=no )
Comment 10 Bawolff (Brian Wolff) 2013-08-04 03:55:37 UTC
I made a patch at https://gerrit.wikimedia.org/r/77562 which would instead of clearing the image redirect cache on page move, simply repopulate it (and hopefully avoid issues with slave db replag). I'm unsure if that would solve the issue here (Since the issue here seems only reproducible on commons, I'm a bit confused as to what's different between commons and enwikipedia - aka I have no idea what's causing this). Nonetheless I think that patch is a step in the right direction.

I also did https://gerrit.wikimedia.org/r/77563  to make this cache be cleared on ?action=purge, since it seems like something that should be.
Comment 11 Bawolff (Brian Wolff) 2013-08-04 03:57:04 UTC
(In reply to comment #4)
> Oh.... well then.... cleared the request. :)

My comment 3 above was in error (It happens to all recent moves on commons < 24 hours old), so I'm resetting that flag.
Comment 12 Greg Grossmeier 2013-08-04 04:50:42 UTC
(In reply to comment #11)
> (In reply to comment #4)
> > Oh.... well then.... cleared the request. :)
> 
> My comment 3 above was in error (It happens to all recent moves on commons <
> 24
> hours old), so I'm resetting that flag.

OK, I'll wait until Gerrit tells me it is merged and we'll go from there.
Comment 13 Bawolff (Brian Wolff) 2013-08-05 21:21:08 UTC
(In reply to comment #10)
> I made a patch at https://gerrit.wikimedia.org/r/77562 which would instead of
> clearing the image redirect cache on page move, simply repopulate it (and
> hopefully avoid issues with slave db replag). I'm unsure if that would solve
> the issue here (Since the issue here seems only reproducible on commons, I'm
> a
> bit confused as to what's different between commons and enwikipedia - aka I
> have no idea what's causing this). Nonetheless I think that patch is a step
> in
> the right direction.
> 

Ok. So there is a way for the user to trigger invalidateImageRedirectCache - namely, making an edit to the redirect (real edit, not a null edit). I tested that with https://commons.wikimedia.org/w/index.php?title=File:Shaik_Mydeen-3.jpg&redirect=no, and my edit seemed to fix the issue, which seems to confirm that it is indeed a problem with that cache.
Comment 14 Gerrit Notification Bot 2013-08-07 20:31:04 UTC
Change 77562 had a related patch set uploaded by Brian Wolff:
More rigorous clearing of image redirect cache

https://gerrit.wikimedia.org/r/77562
Comment 15 Gerrit Notification Bot 2013-08-09 21:29:32 UTC
Change 77562 merged by jenkins-bot:
More rigorous clearing of image redirect cache

https://gerrit.wikimedia.org/r/77562
Comment 16 Bawolff (Brian Wolff) 2013-08-19 22:41:53 UTC
Confirmed fixed (This is now deployed to commons. Can confirm new file redirects do not suffer from this issue)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links