Merge "objectcache: add $flags argument to BagOStuff::delete()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 8 Mar 2019 00:51:25 +0000 (00:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 8 Mar 2019 00:51:25 +0000 (00:51 +0000)
1  2 
includes/libs/objectcache/BagOStuff.php
includes/objectcache/SqlBagOStuff.php

@@@ -732,8 -731,22 +731,15 @@@ 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->setAndLogDBError( $exception );
+       }
+       /**
+        * @param DBError $exception
+        */
+       private function setAndLogDBError( DBError $exception ) {
                $this->logger->error( "DBError: {$exception->getMessage()}" );
                if ( $exception instanceof DBConnectionError ) {
                        $this->setLastError( BagOStuff::ERR_UNREACHABLE );