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 projects: Commons, Multimedia. · View Herald TranscriptNov 4 2017, 2:52 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Reedy added a subscriber: Reedy.Nov 4 2017, 3:15 PM

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 added a subscriber: Ramsey-WMF.

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

Reedy added a comment.Nov 6 2017, 6:15 PM

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 reassigned this task from matthiasmullie to aaron.Mar 29 2019, 5:38 PM
Krinkle triaged this task as Normal priority.
Krinkle edited projects, added Performance-Team; removed Performance.
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

aaron closed this task as Resolved.Apr 1 2019, 7:54 PM