Page MenuHomePhabricator

Usage tracking update / purging on edit and re-parse (tracking)
Closed, ResolvedPublic

Description

Currently, usage tracking info is updated when a page is edited. All old usages are discarded, and the new ones placed in the database.

This does not work in a multi-lingual scenario, since when editing, we only know the usages for one language (the one being rendered immediately upon save, generally the site's nominal content language).

Note that there are three kinds of "page updates" involved (plus deletion):

  1. edit (ArticleEditUpdates)
  2. touch (LinksUpdate), also happens when templates change
  3. render (ParserCache), also happens when viewed with a different target language (if ParserCache is split by user language)

So address this, we should use the following hooks (events) to trigger updates to usage tracking:

  • ArticleEditUpdates: add/touch usage entries from ParserOutput (initially; deprecated in favor of LinksUpdateComplete)
  • ArticleEditUpdates: prune stale entries, unsubscribe unused entries (initially; deprecated in favor of LinksUpdateComplete)
  • LinksUpdateComplete: add/touch usage entries from ParserOutput (should replace ArticleEditUpdates)
  • LinksUpdateComplete: prune stale entries unsubscribe unused entries (should replace ArticleEditUpdates)
  • ParserCacheSave: add/touch usage entries from ParserOutput (needs core patch)
  • ArticleDeleteComplete: prune all entries, unsubscribe unused entries

Event Timeline

daniel created this task.Apr 17 2015, 2:33 PM
daniel raised the priority of this task from to High.
daniel updated the task description. (Show Details)

Candidate hooks:

  • OpportunisticLinkParse
  • LinksUpdateComplete

Edge cases to consider skip:

  • message parse (not page content)
  • parsing old revisions
  • flagged revisions ("approve" revision)

Cases to cover:

  • parse during save (content language?)
  • re-parse due to links-update (template edit)
  • re-parse in user-language

Purge on:

  • edit
  • delete
  • move to "unconnected" namespace
daniel claimed this task.May 6 2015, 4:13 PM
daniel moved this task from Backlog to Doing on the Wikidata-Sprint-2015-05-05 board.
Tobi_WMDE_SW removed daniel as the assignee of this task.May 7 2015, 12:08 PM
Tobi_WMDE_SW moved this task from Doing to Backlog on the Wikidata-Sprint-2015-05-05 board.
daniel claimed this task.May 18 2015, 12:49 PM
daniel moved this task from Backlog to Doing on the Wikidata-Sprint-2015-05-05 board.
daniel updated the task description. (Show Details)May 18 2015, 12:51 PM
daniel updated the task description. (Show Details)May 18 2015, 12:55 PM
daniel renamed this task from Usage tracking update / purging on edit and re-parse to Usage tracking update / purging on edit and re-parse (tracking).May 20 2015, 10:26 AM

Dropped this from the sprint, since it's now a tracking bug.

Rical removed a subscriber: Rical.Jun 8 2015, 4:58 PM
daniel closed this task as Resolved.Jun 10 2015, 4:02 PM

Closing since all but one blockers of the tracking ticket are resolve. The remaining blocker has a comment saying that we probably don't need it, see T99509: [Task] Ignore stale usage entries when processing changes