Last modified: 2014-05-14 14:49: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 T67264, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65264 - File storage uses (title,timestamp) as a unique key, but this is not unique
File storage uses (title,timestamp) as a unique key, but this is not unique
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.23.0
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 15441
Blocks: 65251
  Show dependency treegraph
 
Reported: 2014-05-13 16:33 UTC by Brad Jorsch
Modified: 2014-05-14 14:49 UTC (History)
8 users (show)

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


Attachments

Description Brad Jorsch 2014-05-13 16:33:34 UTC
FileRepo::findFile appears to use the (title,timestamp) pair as a unique key to identify a particular version of a file. However, this is not necessarily unique. See for example https://commons.wikimedia.org/wiki/File:Treppe_22_22_test_upload.jpg where two versions were both uploaded at 2014-05-05T13:00:59Z.

For proper operation, the API requires some ordered unique identifier for file revisions. I imagine there are other places in the code that also require unique identifiers.

This appears to depend on bug 15441 (for the oldimage table), although I'm not familiar enough with the FileBackend code to know for sure whether that's generally the case or if it only applies to certain backends.
Comment 1 Gerrit Notification Bot 2014-05-13 22:04:00 UTC
Change 133178 had a related patch set uploaded by Aaron Schulz:
Made LocalFile avoid duplicate (name,timestamp) pairs

https://gerrit.wikimedia.org/r/133178
Comment 2 Gerrit Notification Bot 2014-05-13 22:21:19 UTC
Change 133178 merged by jenkins-bot:
Made LocalFile avoid duplicate (name,timestamp) pairs

https://gerrit.wikimedia.org/r/133178
Comment 3 Platonides 2014-05-14 00:01:43 UTC
This is probably a duplicate of some older bug.
Comment 4 Brad Jorsch 2014-05-14 14:49:38 UTC
So change 133178 fixed it going forward, which is good. Although I left a comment there.

We'll also need to do database cleanup for situations where this already exists, such as https://commons.wikimedia.org/wiki/File:Treppe_22_22_test_upload.jpg, to completely fix the bug. I also wonder if it's worth making the oi_name_timestamp index unique, although that would only detect the problem after the fact since the row for the current version isn't added to oldimage until a new version becomes current.

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


Navigation
Links