Thread:Project:Current issues/site stats damaged or missing on slave

Hi everyone,

some month ago I've updated our company wiki from 1.15.4 to 1.18.2. I added some Extensions (LDAP_Auth, other Extensions, etc...) and did some minor system modifications like adding an additional &lt;div> tag to the Table of Contents.

The wiki is running on a CentOS Linux machine (Apache, MySQL db).

About one month ago I checked the "Special:Statistics" page as I always did in the morning and there it was:

Active Users: -1

I know that the default value for ss_active_users in the site_stats table is -1 but the value displayed in the database was 66. I checked this value via api and Special:ActiveUsers. I added $wgDebugDumpSql = true; $wgShowDebug = true; to the LocalSettings.php and reloaded the Special:Statistics page.

Here the output: SiteStats::loadAndLazyInit: reading site_stats from slave

Query 17 (slave): SELECT /* SiteStats::doLoad ... */ * FROM `wiki_site_stats` LIMIT 1 SiteStats::loadAndLazyInit: site_stats damaged or missing on slave

Query 18 (slave): SELECT /* SiteStats::doLoad ... */ * FROM `wiki_site_stats` LIMIT 1 SiteStats::loadAndLazyInit: initializing damaged or missing site_stats

Query 19 (slave): SELECT /* SiteStatsInit::edits ... */ COUNT(*) FROM `wiki_revision` LIMIT 1

Query 20 (slave): SELECT /* SiteStatsInit::edits ... */ COUNT(*) FROM `wiki_archive` LIMIT 1

Query 21 (slave): SELECT /* SiteStatsInit::articles ... */ COUNT(DISTINCT page_id) FROM `wiki_page`,`wiki_pagelinks` WHERE page_namespace = '0' AND page_is_redirect = '0' AND (pl_from=page_id) LIMIT 1

Query 22 (slave): SELECT /* SiteStatsInit::pages ... */ COUNT(*) FROM `wiki_page` LIMIT 1

Query 23 (slave): SELECT /* SiteStatsInit::users ... */ COUNT(*) FROM `wiki_user` LIMIT 1

Query 24 (slave): SELECT /* SiteStatsInit::files ... */ COUNT(*) FROM `wiki_image` LIMIT 1

Query 25 (slave): SELECT /* SiteStatsInit::views ... */ SUM(page_counter) FROM `wiki_page` LIMIT 1 DatabaseBase::query: Writes done: DELETE FROM `wiki_site_stats` WHERE ss_row_id = '1'

Query 26 (slave): DELETE /* SiteStatsInit::refresh ... */ FROM `wiki_site_stats` WHERE ss_row_id = '1'

Query 27 (slave): INSERT /* SiteStatsInit::refresh ... */ INTO `wiki_site_stats` (ss_total_edits,ss_good_articles,ss_total_pages,ss_users,ss_images,ss_row_id,ss_total_views) VALUES ('v1','v2','v3','v4','v5','v6','v7')

Query 28 (slave): SELECT /* SiteStats::doLoad ... */ * FROM `wiki_site_stats` LIMIT 1 SiteStats::loadAndLazyInit: site_stats persistently nonsensical o_O

Query 29 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'messages:statistics-header-views' LIMIT 1

Query 30 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'linkPrefixExtension' LIMIT 1

Query 31 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'messages:statistics-views-total' LIMIT 1

Query 32 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'separatorTransformTable' LIMIT 1

Query 33 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'digitTransformTable' LIMIT 1

Query 34 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'messages:statistics-views-total-desc' LIMIT 1

Query 35 (slave): SELECT /* LCStore_DB::get ... */ lc_value FROM `wiki_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'messages:statistics-views-peredit' LIMIT 1 LoadBalancer::getConnection: using server localhost for group SpecialStatistics

Query 36 (slave): SELECT /* SiteStatsUpdate::cacheUpdate ... */ COUNT( DISTINCT rc_user_text ) FROM `wiki_recentchanges` WHERE (rc_user != 0) AND rc_bot = '0' AND (rc_log_type != 'newusers' OR rc_log_type IS NULL) AND (rc_timestamp >= '20121212143454') LIMIT 1

Query 37 (slave): UPDATE /* SiteStatsUpdate::cacheUpdate ... */ `wiki_site_stats` SET ss_active_users = '66' WHERE ss_row_id = '1'

There you can see "site_stats damaged or missing on slave" and other debug messages from SiteStats.php. How is it possible that the correct value of 66 is not displayed on the Special:Statistics page?

For testing I've set up a clean 1.18.2 installation with the current database and I got the same problem. So I think it is a database problem but I don't know if that's right.

Regards,

schrotteh