The site_stats table is now “sharded” (but still on a single node, even in a single table, just split across multiple rows). Several scripts in analytics/wmde/scripts.git query this table and assume a single row; specifically:
$result = $pdo->query( 'select ss_good_articles from wikidatawiki.site_stats' );
$result = $pdo->query( 'select ss_total_edits from wikidatawiki.site_stats' );
$result = $pdo->query( 'select ss_total_pages from wikidatawiki.site_stats' );
$result = $pdo->query( 'select ss_users from wikidatawiki.site_stats' );
All of these just send $rows[0]['ss_field_name'] to Grafana, and MariaDB happens to return the first largest row first:
MariaDB [wikidatawiki]> select ss_total_pages from wikidatawiki.site_stats; +----------------+ | ss_total_pages | +----------------+ | 102160147 | | 7267 | | 7207 | | 7265 | | 7140 | | 7162 | | 7266 | | 7190 | | 7197 | | 7238 | +----------------+ 10 rows in set (0.001 sec)
So as long as MariaDB keeps returning the rows in this order, the scripts still record a roughly accurate number. However, we still need to fix the scripts to actually report the sum of all the rows; the longer we wait, the larger the jump in the graph will be when we finally fix it from “number of pages/etc. until 2022-05-31 plus one tenth of the number of pages since 2022-05-31” to “total number of pages”.

