Page MenuHomePhabricator

File metadata gets refreshed when accessing the file description page
Closed, ResolvedPublic

Description

When accessing a file description page, if the img_metadata field contains a:0:{}, it gets refreshed and populated.

This may be problematic since it's updating the database on an HTTP GET.

Steps to reproduce:

  1. Open a file description page
  2. Update the image table for that file, setting img_metadata to a:0:{}
  3. Reload the file description page
  4. Observe that the img_metadatafiled has been updated

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Tangently related, T32961: Run refreshImageMetadata.php --force (no, I'm not saying we just run the script instead of fixing this issue ;))

Ramsey-WMF moved this task from Untriaged to Triaged on the Multimedia board.
Ramsey-WMF subscribed.

Multimedia team investigating to see if there's a problem or if this is intended functionality.

Multimedia team investigating to see if there's a problem or if this is intended functionality.

FWIW, there is explicitly a problem here; GET actions shouldn't be causing database writes

It looks like this is deferred until post-send, so there shouldn't be a user-visible latency impact. I'm assuming we're talking about LocalFile::maybeUpgradeRow().

Change 499988 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] filerepo: only trigger maybeUpgradeRow() on action=purge

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

Krinkle triaged this task as Medium priority.
Krinkle edited projects, added Performance-Team; removed Performance Issue.
Krinkle added a subscriber: matthiasmullie.

Change 499988 merged by jenkins-bot:
[mediawiki/core@master] filerepo: only trigger maybeUpgradeRow() on action=purge

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