objectcache: remove obsolete code from SqlBagOStuff::handleWriteError()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 7 Mar 2019 21:21:41 +0000 (13:21 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 7 Mar 2019 21:21:41 +0000 (13:21 -0800)
Given that the DB classes already check read-only mode and bad
transaction states are already handled by 3975e04cf4d, this
code was not useful.

Change-Id: I4b6e8909196448a12cf74598de0272fa43bdfc62

includes/objectcache/SqlBagOStuff.php

index 2866a6c..fad7da9 100644 (file)
@@ -732,13 +732,6 @@ class SqlBagOStuff extends BagOStuff {
        protected function handleWriteError( DBError $exception, IDatabase $db = null, $serverIndex ) {
                if ( !$db ) {
                        $this->markServerDown( $exception, $serverIndex );
-               } elseif ( $db->wasReadOnlyError() ) {
-                       if ( $db->trxLevel() && $this->usesMainDB() ) {
-                               // Errors like deadlocks and connection drops already cause rollback.
-                               // For consistency, we have no choice but to throw an error and trigger
-                               // complete rollback if the main DB is also being used as the cache DB.
-                               throw $exception;
-                       }
                }
 
                $this->logger->error( "DBError: {$exception->getMessage()}" );