Merge "Avoid calling rollback() in handleWriteError() if there is no trx"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 25 Feb 2015 09:16:04 +0000 (09:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 25 Feb 2015 09:16:04 +0000 (09:16 +0000)
includes/objectcache/SqlBagOStuff.php

index df878f7..2fb9ff9 100644 (file)
@@ -731,9 +731,11 @@ class SqlBagOStuff extends BagOStuff {
                        $this->markServerDown( $exception, $serverIndex );
                }
                if ( $exception->db && $exception->db->wasReadOnlyError() ) {
-                       try {
-                               $exception->db->rollback( __METHOD__ );
-                       } catch ( DBError $e ) {
+                       if ( $exception->db->trxLevel() ) {
+                               try {
+                                       $exception->db->rollback( __METHOD__ );
+                               } catch ( DBError $e ) {
+                               }
                        }
                }