Page MenuHomePhabricator

Incremental MediaWiki History - v2
Open, Needs TriagePublic

Description

In T424350: Incremental MediaWiki History v1 - Phase I - we delivered a v1 of wmf_mediawiki.mediawiki_history_incremental_v1

Lots of compromises were made to deliver on time - by 2026-06.

In T428273: Incremental MediaWiki History v1.1 (formerly called Phase II) - some of those compromises for v1 are addressed. E.g. more data, more consistency, better performance.

Along the way, many conversations were had about what we would have done if we had more time. Some of that is captured in T425573: mediawiki_history_incremental_v1: schema specification for stakeholder review, some is just in conversations.

This task tracks the creation of MediaWiki History v2 dataset(s).

v2 tables should use the same update pipeline developed for v1, but can have an entirely different schema. The schema will likely look something closer to the MediaWiki state change events that the incremental data is sourced from: mediawiki/page/change, mediawiki/user/change, etc. This will enable event datasets to share a common data model.

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Opentchin
OpenOttomata
OpenJMonton-WMF
OpenJMonton-WMF
OpenOttomata
ResolvedOttomata
ResolvedOttomata
ResolvedOttomata
OpenArielGlenn
In ProgressArielGlenn
In ProgressSpikeArielGlenn
OpenOttomata
InvalidMilimetric
Resolvedtchin
ResolvedOttomata
OpenOttomata
Opentchin
OpenArielGlenn
ResolvedOttomata
ResolvedOttomata
OpenNone
Opentchin
OpenNone
OpenOttomata
OpenNone
OpenNone
OpenOttomata

Event Timeline

@Ottomata's hopes for v2:

  • the core history (event) tables contain only immutable event data. We don't retroactively update past event record values due to future event changes. We don't update the revision visibility state on the revision create event record. Revision visibility changes are event records.
    • We only mutate for event reconciliation purposes, not for updates from latest state
  • Mutable state is computed from immutable event data and stored separate lookup tables. E.g.
    • revision state: current revert state fields, current visibility, etc.
    • page state: current page_title, current page_namespace, etc.
    • user state: current bot-ness, current user_text, current user edit_count, etc
    • etc. etc.
  • Star schemas: 'derived data' about entities is stored in separate join tables (using similar data models), which are also fed by events. The process for creating (modeling, backfilling, updates from events...and hopefully reconciling!) derived data tables is repeatable and streamlined.
    • mediawiki_page_html_content_current <- backfilled html content for all pages
    • mediawiki_article_topic_prediction_history <- backfilled topic predictions for all revisions of all articles
    • mediawiki_article_topic_prediction_current <- backfilled topic predictions for current revision of all articles
    • mediawiki_revert_risk_prediction_history <- backfilled revert risk predictions for all revisions
    • etc. etc.

(TBD on all naming of course!)

I'm sure there are many technical details that will interfere with my hopes and dreams, but let's find them and document them!

Another problem that we should think about for v2 is the issue from T428969: Add source='snapshot+events' for incrementally-enriched snapshot rows:

How can a consumer efficiently update if all they want to consume is the changes since the last time they consumed (AKA the CDC problem)?

Immutability, as discussed above, will help, but reconciliation may make things complicated.

Let's make sure we tackle this early on with consumption scenarios.