https://bugzilla.wikimedia.org/show_bug.cgi?id=33911
Web browser: ---
Bug #: 33911
Summary: Unused ss_admins value may fail SiteStats sanity check
Product: MediaWiki
Version: 1.19-svn
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Database
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Created attachment 9898
--> https://bugzilla.wikimedia.org/attachment.cgi?id=9898
fix for the described bug. Ignore the unused ss_admins field in the sanity
check.
Summary:
The maintenance/initStats.php script, when called, sets the value of the
ss_admin column of the site_stats table to -1. When the Special:Statistics page
is loaded, this negative value is considered an error, leading to an otherwise
perfectly fine database to be flagged as "unsane".
Steps to reproduce
1. View the site_stats table of a MediaWiki installation. Observe that there is
one row, and the ss_admins row is a positive integer, typically "0".
2. Run maintenance/initStats.php --active --update
3. View the site_stats table of a MediaWiki installation. Observe the ss_admins
row is now negative, "-1".
4. Observe that the ss_active_users fields is a positive integer, lets say "A"
4. View the Special:Statistics page of the MediaWiki. View the result after
"Active users (list of members)".
Expected Results:
I expected Special:Statistics to list the actual number of active users.
Actual Result:
I expected Special:Statistics lists "-1" active users.
Regression:
1. The initStats.php deletes and recreates the single record in the site_stats
database, without explicitly setting the ss_admins field. Since the ss_admins
field has a default value of -1, this is the value that is set after
initStats.php is called.
2. In includes/SiteStats.php, the SiteStats::isSane function checks the value
of each row in the site_stats table if the value is in the range
0...2000000000. If it is not, the site statistics are marked as "unsane".
3. If the site statistics are marked as "unsane" even after a reload of the
values, the SiteStats::loadAndLazyInit() function calls
SiteStatsInit::doAllAndCommit() without options parameter. doAllAndCommit()
without $options['activeUsers'] reset the active user count to -1, and that is
the value that is incorrectly shown in the Special:Statistics page.
Recommended fix:
This problem can be fix in 4 distinct ways:
1. Set the default value of sitestats:ss_admins field to 0 instead of -1.
2. Let the initStats.php script set the ss_admins field to a non-negative
value.
3. Change the sanity check to ignore the unused ss_admins record.
4. Call SiteStatsInit::doAllAndCommit() with $options['activeUsers'] from
SiteStats::loadAndLazyInit()
I recommend the third fix. A patch is attached.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l