* Often users restore a batch of many files with similar names.
This fails due to gap locking on non-existing rows which tangles up
unrelated actions. Avoid that locking for the common case.
* This changes the return value of LocalFile::lock() from a useless
one (due to the exception) to one that conveys some useful information.
The method is fairly internal in any case.
Change-Id: Idb86367cf45b731d4b2a67b1813a660bc0e7a84f
* Previously, the file existence checks would not distinguish an answer
in the negative from a non-answer. This was a long-standing problem.
This avoids moving DB entries without moving the files (unless the
partition happens in the middle of the moves of course).
* Optimized fileExistsBatch() to do concurrent stats if possible.
bug: 40927
bug: 69312
Change-Id: I9132fd5591bb7a3d5852f17514dcf51a3d8b7812
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
* This avoids excess contention where inserts of rows for
similarly named files get blocked. This often would effect
users of UploadWizard or any bot doing mass uploads.
Change-Id: Ie7a328f7d4f03aa249770804417347a50356ea42
* If a move is blocked by a re-upload and the TRX started outside of
LocalFile::lock, then the move did not see the new row in the oldimage
table and so it will not move that version of the file in storage. Use
the latest DB data to avoid that.
Change-Id: I7ec46941170293c96b99a449cb396517108e8b3d
The img_metadata field was not being decoded from bytea into text.
This change to core fixes the reported problem with PdfHandler against
1.22.6, origin/REL1_23 and git head.
Bug: 59147
Change-Id: I285a317a57a29713af1f7f630b340278bd5400da
This avoids the use of $wgUser in Revision constructor and makes the
dependency on the global visible.
Change-Id: Ib67bd706a3c4ef081f475406e9aa1094c42222ef
These files have all had treatment before, and these occurrences have either
been missed or have been introduced after.
Change-Id: I06cdab4616b5bff47c85152df28f18c861730a23
* Previously LocalFile cache misses would hit the master DB
(even for shared repos like Commons).
* Since lock() is always called before file changes, this has
been modified to call a new markVolatile() method to track
changing (or recently changed) files in memcached. On cache
miss this tracking is used to decide whether to use the
slave or the master DB.
Change-Id: I942f5e28dd9e0953b6382cc2247ca480494d5718
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I8804ebe0922d3a414863b162a2110e0b9e49b80f
* If the publish() call did not really do anything, then there is
no use in saving the page and file DB records. Previously the
user would get an error but the description page would be made.
bug: 64071
Change-Id: I1959f8c1ef33dbd1b238f6020117d2862d4b0fd3
Previously if an exception was thrown when creating the description
page, the old (negative) memcached entry would not be purged, and
the file would appear not to exist until 24 hours later.
This way, as soon as we have the image row committed to db, we
change the memcache entry, so memcache of image row always looks
like actual image row.
Bug: 32551
Change-Id: I9c260e9a4a1e0d6ade1771542dd834f969904cef
* Lowered the lock() timeout
* Wrap the destination DB write with memcached locks for move
ops since it is easier to control that lock timeout than the
DB lock timeouts.
* Cleanup locks in the destructor (e.g. on exceptions). Other
process can pile up more if locks have to expire.
bug: 63058
Change-Id: I38b28d81ec96daa80ece2354db284a614289ba0b
Due to bug 17259 (which is fixed in a better way in Id44d566a),
imagelinks only records the redirect and not the actual image used when
an image redirect is referenced. This causes various problems, such as
cascading protection not working through image redirects.
It makes more sense for imagelinks to work like tempaltelinks, recording
both so that things like cascading protection don't have to care about
image redirects explicitly.
Comparing imagelinks to templatelinks also reveals a few places
(WikiPage::doDeleteUpdates, WikiPage::doCascadeProtectionUpdates) that
should be triggering a LinksUpdate if the image links changed.
Bug: 23002
Bug: 23542
Bug: 26503
Change-Id: I64fe7d25646cae2c8213211893c6f821f3504dbf