wiki.techinc.nl/includes/deferred/MergeableUpdate.php
Aaron Schulz 390fce6db1 Move user_editcount updates to a mergeable deferred update
This should reduce excess contention and lock timeouts.
Previously, it used a pre-commit hook which ran just before the
end of the DB transaction round.

Also removed unused User::incEditCountImmediate() method.

Bug: T202715
Depends-on: I6d239a5ea286afb10d9e317b2ee1436de60f7e4f
Depends-on: I0ad3d17107efc7b0e59f1dd54d5733cd1572a2b7
Change-Id: I0d6d7ddd91bbb21995142808248d162e05696d47
2018-10-25 15:32:18 -07:00

25 lines
961 B
PHP

<?php
/**
* Interface that deferrable updates can implement to signal that updates can be combined.
*
* DeferredUpdates uses this to merge all pending updates of PHP class into a single update
* by calling merge(). Note that upon merge(), the combined update goes to the back of the FIFO
* queue so that such updates occur after related non-mergeable deferred updates. For example,
* suppose updates that purge URLs can be merged, and the calling pattern is:
* - a) DeferredUpdates::addUpdate( $purgeCdnUrlsA );
* - b) DeferredUpdates::addUpdate( $deleteContentUrlsB );
* - c) DeferredUpdates::addUpdate( $purgeCdnUrlsB )
*
* The purges for urls A and B will all happen after the $deleteContentUrlsB update.
*
* @since 1.27
*/
interface MergeableUpdate extends DeferrableUpdate {
/**
* Merge this update with $update
*
* @param MergeableUpdate $update Update of the same class type
*/
function merge( MergeableUpdate $update );
}