r107377 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107376‎ | r107377 | r107378 >
Date:13:21, 27 December 2011
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
loadPagesFromDB() should query DB_MASTER, otherwise old data is presented right after marking/updating a page for translation.
Modified paths:
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -168,7 +168,7 @@
169169 }
170170
171171 public function loadPagesFromDB() {
172 - $dbr = wfGetDB( DB_SLAVE );
 172+ $dbr = wfGetDB( DB_MASTER );
173173 $tables = array( 'page', 'revtag' );
174174 $vars = array( 'page_id', 'page_title', 'page_namespace', 'page_latest', 'MAX(rt_revision) as rt_revision', 'rt_type' );
175175 $conds = array(

Comments

#Comment by Nikerabbit (talk | contribs)   13:41, 27 December 2011

I must have misunderstood something. I thought that when user makes writes, the load balancer makes sure he sees a linear version of history.

#Comment by Aaron Schulz (talk | contribs)   18:09, 27 December 2011

It stores the master position (attached to the login session) when the user writes something and uses that to wait for a slave to keep up when queried. Though it only waits for so long (5 sec?).

#Comment by Nikerabbit (talk | contribs)   06:38, 28 December 2011

So I should have an explicit command for waiting?

#Comment by Aaron Schulz (talk | contribs)   06:39, 28 December 2011

It should work automagically :)

#Comment by Aaron Schulz (talk | contribs)   18:03, 5 January 2012

So updates didn't show before this change? Is this for making use X see updates for user Y (as opposed to the same user). If it's for the same user seeing their own updates, this *shouldn't* be needed AFAIK.

#Comment by Siebrand (talk | contribs)   18:18, 5 January 2012

The fix is intended for the latter scenario. Hasn't been deployed yet, so not tested in the environment it is meant to fix for.

Status & tagging log