r108591 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108590‎ | r108591 | r108592 >
Date:02:02, 11 January 2012
Author:raindrift
Status:reverted
Tags:
Comment:
sqlite needs its timestamps quoted
fixed some memcache timestamp bugs
followup to r108559
Modified paths:
  • /trunk/phase3/includes/ConcurrencyCheck.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ConcurrencyCheck.php
@@ -103,7 +103,7 @@
104104 array(
105105 'cc_resource_type' => $this->resourceType,
106106 'cc_record' => $record,
107 - '(cc_user = ' . $userId . ' OR cc_expiration <= ' . wfTimestamp( TS_MW ) . ')', // only the owner can perform a checkin
 107+ '(cc_user = ' . $userId . ' OR cc_expiration <= ' . $dbw->addQuotes(wfTimestamp( TS_MW )) . ')', // only the owner can perform a checkin
108108 ),
109109 __METHOD__,
110110 array()
@@ -126,7 +126,7 @@
127127 // this was a cache miss. populate the cache with data from the db.
128128 // cache is set to expire at the same time as the checkout, since it'll become invalid then anyway.
129129 // inside this transaction, a row-level lock is established which ensures cache concurrency
130 - $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => $row->cc_expiration ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() );
 130+ $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => wfTimestamp( TS_UNIX, $row->cc_expiration ) ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() );
131131 $dbw->rollback();
132132 return false;
133133 }
@@ -286,8 +286,8 @@
287287 // safe to store values since this is inside the transaction
288288 $wgMemc->set(
289289 wfMemcKey( 'concurrencycheck', $this->resourceType, $record['cc_record'] ),
290 - array( 'userId' => $record['cc_user'], 'expiration' => $record['cc_expiration'] ),
291 - $record['cc_expiration'] - time()
 290+ array( 'userId' => $record['cc_user'], 'expiration' => wfTimestamp( TS_UNIX, $record['cc_expiration'] ) ),
 291+ wfTimestamp( TS_UNIX, $record['cc_expiration'] ) - time()
292292 );
293293 }
294294 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r108601reverts Concurrency works...hashar09:05, 11 January 2012
r108765moving concurrencycheck code here, as of r108591...raindrift21:38, 12 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108559MERGE branches/concurrency 108301:108557 into trunkraindrift23:03, 10 January 2012

Status & tagging log