Merge "rdbms: clean up DBO_TRX behavior for onTransactionPreCommitOrIdle()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 22 Mar 2018 01:07:06 +0000 (01:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 22 Mar 2018 01:07:06 +0000 (01:07 +0000)
1  2 
includes/libs/rdbms/database/Database.php

@@@ -3395,19 -3294,13 +3395,13 @@@ abstract class Database implements IDat
        }
  
        final public function rollback( $fname = __METHOD__, $flush = '' ) {
-               if ( $flush === self::FLUSHING_INTERNAL || $flush === self::FLUSHING_ALL_PEERS ) {
-                       if ( !$this->trxLevel ) {
-                               return; // nothing to do
-                       }
-               } else {
-                       if ( !$this->trxLevel ) {
-                               $this->queryLogger->error(
-                                       "$fname: No transaction to rollback, something got out of sync." );
-                               return; // nothing to do
-                       } elseif ( $this->getFlag( self::DBO_TRX ) ) {
+               $trxActive = $this->trxLevel;
+               if ( $flush !== self::FLUSHING_INTERNAL && $flush !== self::FLUSHING_ALL_PEERS ) {
+                       if ( $this->getFlag( self::DBO_TRX ) ) {
                                throw new DBUnexpectedError(
                                        $this,
 -                                      "$fname: Expected mass rollback of all peer databases (DBO_TRX set)."
 +                                      "$fname: Expected mass rollback of all peer transactions (DBO_TRX set)."
                                );
                        }
                }