User "Aaron Schulz" posted a comment on MediaWiki.r79518. Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/79518#c19559 Commit summary:
* Modified Article::loadPageData() to use a slave database connection and pageDataFromTitle() instead of pageDataFromId() in the default case, as in Wiki.php (this also saves a query since the ID will be fetched with other fileds) * Removed the loadPageData() call for the initial article in Wiki.php, will be triggered by the isRedirect() call 7 lines below if needed (this was not needed if $target is set by the InitializeArticleMaybeRedirect hook), but kept the second one (same as above, Article::exists() triggers Title::getArticleId() that would use one query to get id and a second one is needed to get the complete page data) * Modified Article::fetchContent() to use common code (loadPageData()) and to only call it if really needed Comment: With chronology protection and the session key having the db position, it normally should be fine to use a slave. I suppose if the slave lag gets really bad (as it does on occasion) you want to fall back to the master. It might be nice to have some kind cache key or something that's set if the lag gets really bad; when the key isn't set, the lag is checked every other X hits. I can't see why we have to use the master for a simple page view. Also, I'd like it if the functions let you choose master or slave. _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
