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 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
Tobi_WMDE_SW moved this task from Doing to Backlog on the Wikidata-Sprint-2015-05-05 board.
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.

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