Page MenuHomePhabricator

File/image redirects on shared repo (commons) are not followed on non-English local sites
Closed, ResolvedPublic


File redirects on Commons work locally and from English sites, but don't seem to be working from other languages...

Works locally:

Works remotely on English:

Fails, showing empty page:

Offhand I'm guessing something's using the local namespace name in a cache or DB lookup, which naturally enough fails when it's difference from what Commons is storing (the English master name).

Version: unspecified
Severity: major



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:49 PM
bzimport set Reference to bz21026.

Think I've found it; setting up a local test to confirm fix before I commit.

Ok confirmed steps to reproduce:

  • Set up shared repo wiki w/ English
  • Set up client wiki w/ French (or other language with non-default 'File:' namespace) using it via ForeignDBRepo, with 'hasSharedCache' on
  • Configure both to use memcached
  • Upload some file to shared repo, say 'Redirect test target.png'
  • Access a so far non-existent file 'Redirect test source.png' *from the client site*
  • Create a redirect *on the shared repo* from 'File:Redirect test source.png' to 'File:Redirect test target.png'
  • Attempt to access 'Redirect test source.png' again from both wikis

Expected result:

  • Functional redirect on English master site
  • Functional redirect on French client site

Actual result:

  • Functional redirect on English master site
  • Missing redirect on French client site, as though the site never exists

The two wikis are caching their redirect lookups under separate keys because the key includes the local namespace name. When the English wiki updates its records for the creation of the redirect, it thus isn't able to clear the negative-lookup record the French wiki cached previously. Until the cache record expires, it won't attempt to look up the redirect in the database again.