To provide usage tracking off tabular data and chart definitions used in the Chart extension (T374746), JsonConfig has been extended (T374747) with an optional cross-wiki usage tracking table set: `globaljsonlinks`, `globaljsonlinks_target`, and `globaljsonlinks_wiki`.
For the production environment these will live on `x1` cluster but for this test deployment (T378127) we don't want to pollute those tables with pre-production data, and will have a temporary installation of these tables on `testcommonswiki` in its existing home.
* Should this table be replicated to wiki replicas (does it not contain private data)?
* ok to replicate (public derived data)
* Will you be doing cross-joins with the wiki metadata?
* no cross-joins, is meant to live standalone. references page_namespace/page_title indirectly on each side.
* Size of the table (number of rows expected).
* 1 row in `globaljsonlinks` per chart invocation, this is expected to be a few tens of thousands of rows
* smaller number of rows in `globaljsonlinks_wiki` and `globaljsonlinks_target` which consolidate strings for source wikis (a few hundred) and target data page references (smaller than the total number of invocations)
* Expected growth per year (number of rows).
* relatively small in future, though it will grow more intensely at first as we migrate old Graphs invocations and create new Charts invocations. on the order of thousands of rows/year expected.
* Expected amount of queries, both writes and reads (per minute, per hour...per day, any of those are ok).
* makes at least one read query per `LinksUpdate` in job queue
* makes inserts/deletes during `LinksUpdate` in job queue
* updating a data page on Commons will trigger a read to distribute cache invalidation jobs
* Examples of queries that will be using the table.
* Mostly SELECTs joining the three globaljsonlinks tables in-place and issuance of fresh INSERTs when recording new links; these either return all matching links for a given outgoing source page or given incoming target page, or return id numbers of existing records.
* No joins against remote tables, only between the tree globaljsonlinks* tables.
* The release plan for the feature (are there specific wikis you'd like to test first etc).
* running it with testcommonswiki as a temporary master for a test rollout
* this will live on s4 in testcommonswiki's regular location
* production version will live on x1 in a standalone database, or commonswiki (whichever makes more sense for deployment)
[X] schema has changed slightly during implementation from original plan. has passed code review. abstract `tables.json` and `tables-generated.sql` files live in JsonConfig extension `sql` subdir and should be ready to run
[ ] Create the tables to `testcommonswiki` on `s4` on a temporary basis, with intent to remove them after tearing down the test deployment -[[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/JsonConfig/+/refs/heads/master/sql/tables.json|Table schema json in Extension:JsonConfig]]
[ ] Deply config patch needed to point `testcommonswiki` & `testwiki`'s `virtual-globaljsonlinks` domain at `testcommonswiki`, and enable `$wgTrackGlobalJsonLinks` for those two wikis to start populating links - https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1087975/