Page MenuHomePhabricator

Move Cargo backlink updates to LinksUpdate
Closed, ResolvedPublic

Description

Currently, Cargo updates backlinks for pages referenced in query results directly from the #cargo_query parser function. This effectively causes it to attempt to write to the primary database in case of a parser cache miss, which can be especially problematic if the primary is read-only (T330253). This functionality could instead be moved to MediaWiki's LinksUpdate mechanism, so that the backlinks are updated at the same time as other MediaWiki link tables, avoiding potential DB writes on page views.

Event Timeline

Change 921440 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/extensions/Cargo@master] [WIP] Move backlink updates to LinksUpdate

https://gerrit.wikimedia.org/r/921440

To the extent that I understand this patch, it looks great! I know there are some DB issues with the current backlinks implementation, so it would be great to get them fixed. Good luck with this.

Change 921440 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Move backlink updates to LinksUpdate

https://gerrit.wikimedia.org/r/921440

I assume this could have been closed as soon as the patch was merged in.

Thank you, I forgot to circle back and close this task.

We completed the rollout of this change about two weeks ago, and saw a notable decrease in DB writes performed by Cargo afterwards, which is very nice.

Screenshot 2023-07-04 at 15.19.22.png (836×1 px, 245 KB)