Split out new RefreshSecondaryDataUpdate class
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Oct 2018 20:45:23 +0000 (13:45 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 15 Mar 2019 17:14:50 +0000 (17:14 +0000)
commita1f7fd3adaa380b276aefa467ec90fce4c916ce6
treef48720aa32c0ff1c54aedcf0bb74f06ebcb15385
parentc7d3fcebc435e35389c0ae49bb37d7199e329ac1
Split out new RefreshSecondaryDataUpdate class

Make DerivedPageDataUpdater bundle all the related DataUpdate tasks
on page change with a RefreshSecondaryDataUpdate wrapper. If one of
the DataUpdate tasks fails, then the entire bundle of updates can be
re-run in the form of enqueueing a RefreshLinksJob instance (these
jobs are idempotent). If several of the bundled tasks fail, it is easy
for DeferredUpdates to know that only one RefreshLinksJob should be
enqueued.

The goal is to make DataUpdate tasks more reliable and resilient.
Most of these deferred update failures are due to ephemeral problems
like lock contention. Since the job queue is already able to reliably
store and retry jobs, and the time that a regular web request can spend
in post-send is more limited, it makes the most sense to just enqueue
tasks as jobs if they fail post-send.

Make LinkUpdate no longer defined as enqueueable as RefreshLinksJob
since they are not very congruent (LinksUpdate only does some of the
work that RefreshLinksJob does). Only the wrapper, with the bundle of
DataUpdate instances, is congruent to RefreshLinksJob.

This change does not itself implement the enqueue-on-failure logic
in DeferredUpdates, but is merely a prerequisite.

Bug: T206288
Change-Id: I191103c1aeff4c9fedbf524ee387dad9bdf5fab8
autoload.php
includes/Storage/DerivedPageDataUpdater.php
includes/deferred/LinksUpdate.php
includes/deferred/RefreshSecondaryDataUpdate.php [new file with mode: 0644]