Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php |
— | — | @@ -198,12 +198,9 @@ |
199 | 199 | if ( !$this->doLockingQuery( $lockDb, $keys, $type ) ) { |
200 | 200 | return 'cantacquire'; // vetoed; resource locked |
201 | 201 | } |
202 | | - // Check that DB has no signs of lock loss |
203 | | - if ( $this->checkUptime( $lockDb ) ) { |
204 | | - ++$yesVotes; // success for this peer |
205 | | - if ( $yesVotes >= $quorum ) { |
206 | | - return true; // lock obtained |
207 | | - } |
| 202 | + ++$yesVotes; // success for this peer |
| 203 | + if ( $yesVotes >= $quorum ) { |
| 204 | + return true; // lock obtained |
208 | 205 | } |
209 | 206 | } catch ( DBConnectionError $e ) { |
210 | 207 | $this->cacheRecordFailure( $lockDb ); |
— | — | @@ -301,28 +298,8 @@ |
302 | 299 | } |
303 | 300 | |
304 | 301 | /** |
305 | | - * Checks if the DB server did not recently restart. |
306 | | - * This curtails the problem of locks falling off when DB servers restart. |
307 | | - * |
308 | | - * @param $lockDb string |
309 | | - * @return bool |
310 | | - * @throws DBError |
311 | | - */ |
312 | | - protected function checkUptime( $lockDb ) { |
313 | | - if ( isset( $this->conns[$lockDb] ) ) { // sanity |
314 | | - if ( $this->safeDelay > 0 ) { |
315 | | - $db = $this->conns[$lockDb]; |
316 | | - return ( $db->getServerUptime() > $this->safeDelay ); |
317 | | - } |
318 | | - return true; |
319 | | - } |
320 | | - return false; |
321 | | - } |
322 | | - |
323 | | - /** |
324 | 302 | * Checks if the DB has not recently had connection/query errors. |
325 | | - * When in "trust cache" mode, this curtails the problem of peers occasionally |
326 | | - * missing locks. Otherwise, it just avoids wasting time on connection attempts. |
| 303 | + * This just avoids wasting time on doomed connection attempts. |
327 | 304 | * |
328 | 305 | * @param $lockDb string |
329 | 306 | * @return bool |
— | — | @@ -337,12 +314,8 @@ |
338 | 315 | } |
339 | 316 | |
340 | 317 | /** |
341 | | - * Log a lock request failure to the cache. |
| 318 | + * Log a lock request failure to the cache |
342 | 319 | * |
343 | | - * Worst case scenario is that a resource lock was only |
344 | | - * on one peer and then that peer is restarted or goes down. |
345 | | - * Clients trying to get locks need to know if a DB server is down. |
346 | | - * |
347 | 320 | * @param $lockDb string |
348 | 321 | * @return bool Success |
349 | 322 | */ |
Index: branches/FileBackend/phase3/includes/AutoLoader.php |
— | — | @@ -496,7 +496,7 @@ |
497 | 497 | 'ScopedLock' => 'includes/filerepo/backend/lockmanager/LockManager.php', |
498 | 498 | 'FSLockManager' => 'includes/filerepo/backend/lockmanager/FSLockManager.php', |
499 | 499 | 'DBLockManager' => 'includes/filerepo/backend/lockmanager/DBLockManager.php', |
500 | | - 'MySqlLockManager'=> 'includes/filerepo/backend/lockmanager/LockManager.php', |
| 500 | + 'MySqlLockManager'=> 'includes/filerepo/backend/lockmanager/DBLockManager.php', |
501 | 501 | 'NullLockManager' => 'includes/filerepo/backend/lockmanager/LockManager.php', |
502 | 502 | 'FileOp' => 'includes/filerepo/backend/FileOp.php', |
503 | 503 | 'StoreFileOp' => 'includes/filerepo/backend/FileOp.php', |