Last modified: 2012-02-02 00:17:08 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 T33731, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31731 - Swift thumbnail cache with purgeThumbList() hook
Swift thumbnail cache with purgeThumbList() hook
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.18.x
All All
: High enhancement (vote)
: ---
Assigned To: Aaron Schulz
: platformeng
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-15 16:22 UTC by Tim Starling
Modified: 2012-02-02 00:17 UTC (History)
2 users (show)

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


Attachments

Description Tim Starling 2011-10-15 16:22:05 UTC
The first stage of Swift deployment will involve using Swift as a persistent, reliable thumbnail cache, which will reduce the load on the ms5 backend. In order to use Swift as a cache, we need the ability to purge it. 

This deployment stage is temporary, eventually we will use a SwiftBackend which will be able to purge thumbnails by overriding the relevant method. But for now, we just want a hook into LocalFile::purgeThumbList(). The hook will connect to Swift and delete the cached files.
Comment 1 Aaron Schulz 2011-10-20 18:13:47 UTC
In function hooked onto purgeThumbList(), is the plan to use the FS thumb path strings as the Swift object names (e.g. "$dir/$file")?

Where will the swift thumb caches be generated? thumb.php seems like the best choice, since it already gets the File object and does parameter validation and such. So then another hook will be needed there too.
Comment 2 Aaron Schulz 2011-10-20 18:48:19 UTC
(In reply to comment #1)
> Where will the swift thumb caches be generated? thumb.php seems like the best
> choice, since it already gets the File object and does parameter validation and
> such. So then another hook will be needed there too.

Gah, never mind that. If ms5 load needs to be reduced, that's way too far down the chain (http://wikitech.wikimedia.org/images/1/1c/Thumbnail_request_path.jpg). I guess a new 404-handler layer is needed before ms5/nginx.
Comment 3 Aaron Schulz 2011-10-24 19:39:50 UTC
It might be better placed in purgeThumbnails() and purgeOldThumbnails(). The hook would just pass in $dir, and the handler would have to transform $dir (via regex or something ugly) to truncate away the ".../thumb/" prefix.

purgeThumbList() has no outside callers and we don't want to just purge the files found on the FS but everything under $dir (or the corresponding swift "directory" for the file name). Ideally the file lists would correspond exactly, but we wan't to deal with files stuck in the swift cache because they aren't on the FS and thus don't end up in the purge list.
Comment 4 Tim Starling 2011-10-25 05:09:00 UTC
(In reply to comment #3)
> It might be better placed in purgeThumbnails() and purgeOldThumbnails(). The
> hook would just pass in $dir, and the handler would have to transform $dir (via
> regex or something ugly) to truncate away the ".../thumb/" prefix.
> 
> purgeThumbList() has no outside callers and we don't want to just purge the
> files found on the FS but everything under $dir (or the corresponding swift
> "directory" for the file name). Ideally the file lists would correspond
> exactly, but we wan't to deal with files stuck in the swift cache because they
> aren't on the FS and thus don't end up in the purge list.

OK, sounds good.
Comment 5 Aaron Schulz 2011-10-31 21:43:49 UTC
Code committed in r101387.
Comment 6 Aaron Schulz 2012-02-02 00:17:08 UTC
Deployed.

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


Navigation
Links