Last modified: 2007-04-26 17:56:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9669 - RebuildRecentChanges logic error
RebuildRecentChanges logic error
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-04-23 15:21 UTC by Jason Potkanski
Modified: 2007-04-26 17:56 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Jason Potkanski 2007-04-23 15:21:40 UTC
I spent the morning with ...

Background: I had a user who was complaining the watchlist history was too 
short. Wikipedia's is 30 days, yet default Mediawiki is only 7 days. This 
required changing from $wgRCMaxAge = 7 * 24 * 3600; to $wgRCMaxAge = 30 * 24 * 
3600; I could have just left it and said watchlists will appear correct from 
now on...but rebuilding the recentchanges table looked tempting.

Bug: After running rebuildrecentchanges.php on a heavily edited wiki, recent 
changes appears "empty."

Cause: Debugging found a hard coded limit 5000 in and 
a logic error with the ORDER BY. ORDER BY defaults to an ascending sort with 
timestamps. If you hit the hard coded limit, your recent changes table will 
only show a few days in the deep past. Ex: If the range was April 23rd to March 
23rd, the rebuild only populated the recentchanges table from March 23rd to 
March 29th. Expected behavior would be that it would populate from April 23rd 
back until it hit either the limit or time() - $wgRCMaxAge.

* Add DESC to ORDER BY: array( 'ORDER BY' => 'rev_timestamp DESC', 'LIMIT' => 
5000 )
* Raise Limit: array( 'ORDER BY' => 'rev_timestamp DESC', 'LIMIT' => 100000 )
* or Eliminate Limit: array( 'ORDER BY' => 'rev_timestamp DESC' )
* Default $wgRCMaxAge = 7 * 24 * 3600; is a bit low, suggest $wgRCMaxAge = 60 * 
24 * 3600; which is twice the Wikipedia setting.
Comment 1 Brion Vibber 2007-04-26 17:56:14 UTC
The order was broken during the 1.5 schema change; fixed in r21628

Note You need to log in before you can comment on or make changes to this bug.