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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11669, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9669 - RebuildRecentChanges logic error
RebuildRecentChanges logic error
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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

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 rebuildrecentchanges.inc 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.

Fix: 
* 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' )
 
Suggestion: 
* 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.


Navigation
Links