Commit graph

17 commits

Author SHA1 Message Date
Daimona Eaytoy
6469955810 Replace User, Title, and WikiPage in more signatures
Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
2024-07-10 01:25:57 +02:00
Ebrahim Byagowi
389b1d0436 Add namespace and deprecation alias to RefreshSecondaryDataUpdate
This patch introduces a namespace declaration for the
MediaWiki\Deferred to RefreshSecondaryDataUpdate and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: I9ee3282918f8f3d444a12ca32434a15e93952055
2024-05-20 19:05:24 +03:30
Umherirrender
62c1bd5abc deferred: Add a freshness option to RefreshSecondaryDataUpdate
Allows to trigger RefreshSecondaryDataUpdate jobs with a timestamp to
ensure a link update was done after that timestamp.

Since e5655255 it is possible that RefreshSecondaryDataUpdate gets
queued for api action=purge, but RefreshSecondaryDataUpdate only checks
that the links update is done after the last edit, so when jobs get
queued by action=purge, the jobs does nothing.
Ensure that page_links_updated gets updated via action=purge when the
timestamp is before the new freshness timestamp (checked in
RefreshLinksJob::isAlreadyRefreshed).

Bug: T351729
Change-Id: I85aed4c40d430ba6c30c763141f4b821c36e6eaf
2023-12-27 16:07:06 +01:00
Gergő Tisza
8996117e6f
Document RefreshLinksJob parameters
Also, simplify parameter handling when RefreshSecondaryDataUpdate
generates a RefreshLinksJob specification as there is no way for
the user/revision to be null.

Change-Id: I9ede49123e253dbf190b1a08a3ebb317dbabd17d
2023-12-20 15:00:37 -08:00
Umherirrender
72d6b46339 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements and changes to docs done manually

Change-Id: I443aada1c18c8628b02671aa9fd6f441961e5c2e
2023-12-11 16:07:18 +01:00
Timo Tijhof
e56552557f deferred: Decouple DeferredUpdates from MediaWikiServices
* Create task-specific methods with simple defaults that require no
  mocking or stubbing of any kind, as used by the pure unit tests
  where service container (and by extent, storage services) are
  disabled.

* Remove all use of global variables, LBFactory, JobQueue,
  StatsdFactory, and RequestContext.

Bug: T265749
Change-Id: If85c448d2d1b806e70f641f06263680d49c6eeec
2023-09-09 20:42:02 +01:00
Tim Starling
682aad7557 Move LinksUpdate and LinksDeletionUpdate into the new namespace
Change-Id: I5cf7a08324d08aa89c23540222ba8eddc1ae2647
2022-01-04 15:35:57 +11:00
Petr Pchelko
35f38e995b Remove User from LinksUpdate
This does a breaking change, but all (2) known usages
of the LinksUpdate::getTriggeringUser are satisfied
by UserIdentity.

Change-Id: I682ee65f7b3d30fe6c0fe76d5106857ddfa6da5d
2021-09-13 09:40:24 -07:00
James D. Forrester
3407458ea0 MWExceptionHandler: Rename rollbackMasterChangesAndLog to rollbackPrimaryChangesAndLog
Change-Id: I9a90b4f74eb65cd9e20ae9faa6d1949be96543c0
2021-09-03 17:36:34 -07:00
James D. Forrester
5ad7ca7eba ILoadBalancer/ILBFactory: Rename commitMasterChanges() to commitPrimaryChanges()
Bug: T282894
Change-Id: I0d80be56e683924254c4e38d05e1109ea74eeab5
2021-09-02 11:27:10 -07:00
Umherirrender
d790580fda Fix typos related to repeated words
Change-Id: Ibc187d95b003017255bc87adf56afae7a59bd3db
2020-09-27 10:25:36 +00:00
jenkins-bot
24b1aaeb98 Merge "RefreshSecondaryDataUpdate: Commit before running sub-updates" 2020-04-11 09:47:31 +00:00
DannyS712
318e20df37 Replace uses and hard deprecate LinksUpdate revision methods
Also removes all uses of Revision from RefreshSecondaryDataUpdate

Bug: T249397
Change-Id: Ic110a66f79db8c5834847b664f3a8449eceb9d83
2020-04-09 22:03:24 +00:00
Brad Jorsch
b8858d6d5b RefreshSecondaryDataUpdate: Commit before running sub-updates
The call to `$this->updater->getSecondaryDataUpdates()` probably started
an implicit transaction, and a sub-update may have tried to register a
callback to watch for a rollback which would make that implicit
transaction non-empty.

Bug: T248003
Change-Id: Ib9db8ec9c43c8b2871f283733ed6a05d2dec6dd1
2020-04-09 11:17:00 -04:00
Aaron Schulz
1f4efc6c34 Add RefreshSecondaryDataUpdate and use it in DerivedPageDataUpdater
This class implements EnqueueableDataUpdate and can be pushed as a
job if it fails to run via DeferredUpdates.

Unlike a1f7fd3ada, make RefreshSecondaryDataUpdate skip failing
updates in doUpdate(). Instead of throwing the first exception from
any update, log any exceptions that occur and try all the other
updates. The first error will be re-thrown afterwards.

Also, make sure that each DataUpdate still has outer transaction
scope. This property is documented at mediawiki.org and should not
be changed.

Add integration tests for RefreshSecondaryDataUpdateTest.

Bug: T218456
Bug: T206283
Change-Id: I7c6554a4d4cd76dfe7cd2967afe30b3aa1069fcb
2020-03-11 00:42:48 -07:00
Timo Tijhof
6b7ddf9c9b Revert "Split out new RefreshSecondaryDataUpdate class"
This reverts commits a1f7fd3ada, 0ef02cd018.

Bug: T218456
Change-Id: I9bbea3d13460ed44755d77fc61ff23fb906cf71e
2019-03-19 14:51:27 +00:00
Aaron Schulz
a1f7fd3ada 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
2019-03-15 17:14:50 +00:00