Commit graph

57 commits

Author SHA1 Message Date
Antoine Musso
bcf0010c51 prettify filerepo documentation
Change-Id: Ia84494c8c0c09a3d509975d63ab698e0a35c4631
2012-07-10 17:08:51 +02:00
Tim Starling
fcd74e5dd3 Merge "Reduced some master queries by adding flags to Revision functions." 2012-06-28 05:11:04 +00:00
Aaron
8288b34eae Reduced some master queries by adding flags to Revision functions.
* The main Revision functions now allow various QoS and locking flags.
* Added tiny DBAO interface add made Revision implement it.
  Since a lot of objects will need (or have) the same functionality.
* Use "self" keyword in Revision class consistently.
* Made Revisison::newFromConds() private.

Change-Id: I3139956999218a2bb44b5c845b8079e33b2328bb
2012-06-27 20:59:20 -07:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Catrope
7e6cd60977 Merge "[FileRepo] Fixed file move data-loss race condition." 2012-06-05 22:28:17 +00:00
Demon
1dc986a90f Merge "[FileRepo] Made getDescription() respect *_deleted fields." 2012-06-04 20:41:52 +00:00
Aaron Schulz
04804e67d5 [FileRepo] Fixed file move data-loss race condition.
* Update the DB before copying the files over.
  This fixes a serious regession from 395c5907ff.

Change-Id: Ibeec2cda839adecf28f4b944fa1cdb6e4eff7e3b
2012-06-03 01:49:35 -07:00
Aaron Schulz
4fa67221df Merge "$wgUseSquid unused since parent commit (fa1a8d5)" 2012-05-28 22:36:38 +00:00
Platonides
e73515b10c $wgUseSquid unused since parent commit (fa1a8d5)
Change-Id: I47e103e6c4bb44f74f9d940505775ac2f2e66b29
2012-05-28 19:32:18 +02:00
Aaron
9f6afeab0d [FileRepo] Made getDescription() respect *_deleted fields.
Change-Id: I1dd54611501d6747fb4ad6cbe6b58b0010b1d6d4
2012-05-25 16:00:49 -07:00
Aaron Schulz
b22063a6f9 When file sha1 populator fixes wrong values, make it fix the other metadata.
Change-Id: Ie03af8b97dc76d2ab4990108b9189693fcf81697
2012-05-23 12:04:29 -07:00
Aaron
826f82eacc [FileRepo] Avoiding useless purging for new uploads (not re-uploads).
Change-Id: If554c14c786cd5f743c4d8302660a8b1e5295393
2012-05-22 11:36:43 -07:00
Aaron
dfa7120f1b [FileRepo] Added more upload profiling.
Change-Id: Ib79306fde3470ccaa1f6822b894f1b61f16d772b
2012-05-18 17:56:53 -07:00
Aaron
d0facbf7b1 [FileRepo] Disabled ancient migration code, kills performance.
Change-Id: I6ed49f447dda3235e22edbbf837dad66c66d0764
2012-05-18 15:35:23 -07:00
Reedy
6885d1fd90 Parameter documentation stuffs
Change-Id: I2d9e800bf21d420fb26c130d0f271f6739c730a4
2012-05-11 00:09:58 +01:00
Aaron
b9ac85cbf3 [SiteStatsUpdate] Changing raw DB update calls to use SiteStatsUpdate.
* Made SiteStatsUpdate fields protected
* Added factory function for unretarded object construction
* Changed FileRepo code to use deferred stats updates like everything else

Change-Id: I93039104b14f0362509e37b6852604ffb0898dc7
2012-05-09 14:17:56 -07:00
Aaron
fa1a8d5119 [FileRepo] Purging/transaction fixes.
* Purge old version thumbnails on move
* Pushed purge operations outside of the DB transaction for move/delete

Change-Id: I260940149599eea814226d3c5b7092f4d6544a72
2012-05-08 17:29:39 -07:00
Brion VIBBER
364be04f3f Merge "[FileRepo] Locking and transaction fixes." 2012-05-08 20:21:44 +00:00
Alexandre Emsenhuber
d5381d0ea0 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Iad15427368d13a6cc11c8512b7265e8c7b8878a5
2012-05-07 09:11:33 +02:00
Aaron Schulz
43aa35016b [FileRepo] Locking and transaction fixes.
* Make sure locks for file moves cover the whole operation.
* Pushed purging out of the move/delete/restore transactions.

Change-Id: I398c5627808fa79739f0dee632c4edf7416507c1
2012-05-06 23:28:07 -07:00
Aaron
ba1f104701 Split out quickCleanDir() function just for thumbnails for consistency.
Change-Id: I02f3eefc703016ac5681128de05ff09e716646d1
2012-04-25 10:47:59 -07:00
Aaron
6f7ee691ed Bug 34934: allow moving files with rows with bad oi_archive_name values.
Note that delete/restore already work in such cases.

Change-Id: I6b98b219b548203c4677f5be6f703585ac2cd027
2012-04-20 12:49:49 -07:00
Aaron
ffb1b38ad8 [FileRepo] Split out store/purge functions for thumbnails and made them skip file journals.
* Added quickImport()/quickPurge() functions to store and delete files as fast as possible.
* Also added a cleanDir() function to avoid having File directly use FileBackend functions.

Change-Id: I9a19862f1a720c5a464bd37f79b58a505c5961f9
2012-04-16 16:52:15 -07:00
Aaron Schulz
2d692b5844 Merge "Fix repo type of a LocalFile to be LocalRepo, which has a cleanupDeletedBatch which returns a value" 2012-04-07 23:34:41 +00:00
Reedy
9dfa34c827 Fix repo type of a LocalFile to be LocalRepo, which has a cleanupDeletedBatch which returns a value
Change-Id: Iaa4ba2da9aefbf0ca0eae4caa0eb75bf516a9369
2012-04-07 20:10:02 +01:00
Reedy
eec2278196 Fix duplicate array key of fa_deleted in LocalFile
Change-Id: I027f902d47616d896df8efba29d25457e4ac3e73
2012-04-07 17:11:19 +01:00
Aaron Schulz
5d585a423f [FileRepo] Added some cache code based on the problems in r97512.
* Made RepoGroup avoid caching files with large metadata and also reduced max cache size to 500 to avoid OOMs.
* Factored out a pingCache() function in RepoGroup.

Change-Id: I52f6413b9eb8b11fbffbde0f0e7acf97c7a2ff89
2012-04-06 12:39:58 -07:00
Aaron Schulz
c8e1463cc0 [FileRepo] Various code cleanups.
* Made File::isHashed() wrap FileRepo::getHashLevels(). Removed now-used FileRepo::isHashed().
* Removed FileRepo::simpleClean(). Not useful anymore since the paths in Status errors don't have $IP or upload dirs anymore.
* Removed code in FileRepo::fileExistsBatch() and FileRepo::cleanupBatch() to handle FS file paths, which should never be passed in anymore. Likewise, removed FILES_ONLY parameter.
* Removed FileRepo::append()/appendFinish() stub functions.
* Added FileRepo::assertWritableRepo() function to better handle repos that are read-only by design rather than the hack of overwriting each function (several were missed).
* Added FileBackend::isPathTraversalFree() function and used it in FileRepo::validateFilename() to avoid duplication.
* Tweaked FileRepo::freeTemp() to avoid file locking and made FileRepo::cleanupBatch() return a Status.
* Moved FileRepo::cleanupDeletedBatch() near FileRepo::deleteBatch().
* Added type hinting to a few places.
* Tweaked some misleading doc comments and added function visibility markers.

Change 1:
* Simplified NullRepo to also use assertWritableRepo(). It is currently only used by a single unit test.

Change-Id: I1cd0f4971011772e38e5156f94ffc50325372f28
2012-04-05 12:48:47 -07:00
Aaron Schulz
2330bd514a [FileRepo]
* Added getReadOnlyReason() function to FileRepo to check read-only status. Added such checks to the File object functions that mutate files in storage. This should make read-only mode more tolerable (which is needed at least briefly when switching backends).
* Added lock()/unlock() calls to File restore() function.
* Use proper isOK() accessor for Status objects.

Change-Id: I7368912b01f7fd1ec34125d12c0844388cbb3b2d
2012-03-23 12:23:01 -07:00
Roan Kattouw
0fca9a7991 Revert r107309, r113601, r113704, r113742, r113792, r113838, r113859, r113893, r113894, r113952, r114047, r114252, r114256, r114257. This reverts the remaining 'new' revisions in core.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 00:16:50 +00:00
Aaron Schulz
7770391b30 [FileRepo] Added long-since missing FOR UPDATE to LocalFile::lock(). This might help with the weird mismatched metadata for files with two uploads at the same time that I keep seeing in the DB. 2012-03-20 00:57:18 +00:00
Aaron Schulz
9b02dc95fa [FileRepo]
* Added getReadOnlyReason() function to FileRepo to check read-only status. Added such checks to the File object functions that mutate files in storage. This should make read-only mode more tolerable (which is needed at least briefly when switching backends).
* Added lock()/unlock() calls to File restore() function.
* Use proper isOK() accessor for Status objects.
2012-03-14 21:30:26 +00:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00:00
Aaron Schulz
286abc08bd Disable file locking for thumbnail purging just as it already is with creation/updates (for performance). 2012-03-09 01:18:32 +00:00
Tim Starling
86ec766e19 Fix for r113312: explain the bug without the use of commented-out code 2012-03-07 23:00:42 +00:00
Aaron Schulz
cb93e4c51d [FileRepo]
* Made upload() explicitly check $status->successCount rather than isOk() as FileRepo::publish() gives fatal statuses where it used to only give warnings. This way, failed uploads still displace the current image DB row to oldimage rather than do nothing and have the same image row point to a new file (which can cause mismatched metadata).
* Disabled exception about invalid oi_archive_name. This makes things more broken in that when people get this an error on upload (which happens when the FS has no current file but the DB does), the new file is added as the current version in the FS but the DB is unchanged. Thus, the metadata can be mismatched.
2012-03-07 22:46:47 +00:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Antoine Musso
73247df204 Remove backslash from @return types
Ping r111103
2012-02-13 16:35:59 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00
Sam Reed
e1d83d5721 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:54 +00:00
Antoine Musso
394c8b5234 enhance filerepo doc structure 2012-02-08 15:51:16 +00:00
Alexandre Emsenhuber
f0faee8ae9 Pass the user doing the upload to WikiPage::doEdit() 2011-12-27 15:15:38 +00:00
Aaron Schulz
aa3befb2e0 In LocalFile:
* Removed bogus rmdir() call.
* Added lock() calls to upgradeRow()/getSha1().
* Use FileRepo getFileSha1() in getSha1() rather than via FSFile.
* Made purgeThumbList()/migrateThumbFile() use FileRepo::cleanupBatch().
* A few other minor cleanups.
* w/s cleanup in recordUpload2().
In FSRepo:
* Removed deleted zone config code from constructor; useless since r107028.
In FileBackend:
* Make sure 'latest' param gets passed through via $params for some functions.
* Cleaned up doMoveInternal() to use *_Internal() functions.
2011-12-26 23:35:40 +00:00
Aaron Schulz
b9efeb2cbc FU r106752: fixed call to bogus function in LocalFile::getSha1() 2011-12-24 00:19:01 +00:00
Aaron Schulz
14863b9aa5 Cleaned up some references to FSRepo in code and comments. This should have no noticeable functional changes. 2011-12-20 19:25:23 +00:00
Brian Wolff
34791773f8 follow-up r98710/r104410. I personally think that forRefresh is confusing, since a purge is always in essence a "refresh"ing operation. change it to forThumbRefresh. 2011-12-20 06:48:05 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00