Page MenuHomePhabricator

Server Side Edit Suggestions - Linked Artifacts Cache precompute job
Open, Needs TriagePublic

Description

For T428816: [EPIC] Surface edit suggestion counts to logged-in editors on articles (Phase 1), counts of edit suggestions on a page revision will be stored and served outside of VisualEditor.

The proposed architecture uses Linked Artifacts Cache as the storage for suggestion counts. A 'lambda' behind LAC will compute the edit suggestions for the page.

Since LAC is a cache, and we want edit suggestions computed as soon as possible after a page is edited, we need a mechanism to 'warm' the cache. Something to trigger the compute of edit suggestions for the new revision.

The proposed architecture uses MediaWiki JobQueue to do this. There are several triggers that may cause edit suggestions for a page to be invalid, but for Phase 1 we will focus solely on edits, i.e. when new revisions are created.

Note that not all wikis or pages have edit suggestions. We will only call the LAC endpoint (triggering the computation) for configured wikis and page namespaces.

For T432286: [MILESTONE] Run technical pilot to evaluate Headless VE resource requirements, we may also need the ability to configure some sampling to avoid triggering the computation for all pages while the compute mechanism (Headless VE) is evaluated.


Another identical use case is T403254: Article topic cache backfilling. That task encompasses backfilling, but also ongoing updates for page revision article topics, which are stored in LAC.

Warming LAC after changes in MediaWiki state is likely a common use case; the implementation to do this should probably be generic, and not Edit Suggestion specific.

Additionally: the proposed architecture has edit suggestion change events emitted to Kafka for data reusability. There is currently a mediawiki.page_outlink_topic_prediction_change_v1 stream emitted by LiftWing. This is done via change-prop. If LiftWing usages fit nicely in LAC, it may be possible to decouple LiftWing from change-prop by emitting events from MediaWiki after LAC is warmed. A new MediaWiki DomainEvent that can be subscribed to after an artifact is warmed can be used to translate from LAC response to Event Platform event, while keeping the cache warming mechanism decoupled from the event producing mechanism.


Done is

  • Edit Suggestion LAC endpoint is called after new revisions are created.
  • Which pages for which new revisions call LAC can be configured, e.g. via sampling.

Event Timeline

Ottomata updated the task description. (Show Details)
Ottomata renamed this task from Server Side Edit Suggestions - Linked Artifacts Cache warmer to Server Side Edit Suggestions - Linked Artifacts Cache precompute job.Wed, Jul 22, 4:36 PM

Change #1315339 had a related patch set uploaded (by Ottomata; author: Ottomata):

[mediawiki/extensions/EventBus@master] EditSuggestionCounts: precompute counts in LAC after page edits

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

EditSuggestionCounts: precompute counts in LAC after page edits (1315339) is an EditSuggestionsCount PoC patch that does the same thing PoC - Linked Artifacts Cache warming job (1305805) does.

As we do this technical pilot, we should probably just use the EditSuggestionsCount specific code with the plan to throw it away in favor of a the more agnostic LinkedArtifacts patch.

@Esanders this code probably shouldn't live in EventBus. Does Editing team own any extensions that might be more appropriate for this for now?

Change #1318258 had a related patch set uploaded (by Ottomata; author: Ottomata):

[mediawiki/extensions/VisualEditor@master] EditSuggestionCounts: trigger compute in LAC after new page revisions

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

Change #1315339 abandoned by Ottomata:

[mediawiki/extensions/EventBus@master] EditSuggestionCounts: precompute counts in LAC after page edits

Reason:

Moving to VisualEditor extension in I50c746f1fa0b5b865b4a141e5c857414f6684141

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

Change #1318258 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] EditSuggestionCounts: trigger compute in LAC after new page revisions

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