From: Aaron Schulz Date: Mon, 2 Jul 2018 15:49:28 +0000 (+0100) Subject: rdbms: give TransactionProfiler write time and row count for ROLLBACK X-Git-Tag: 1.34.0-rc.0~4723^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=e73f4a21f5f869562935584fff4860b534206a62;p=lhc%2Fweb%2Fwiklou.git rdbms: give TransactionProfiler write time and row count for ROLLBACK This will hopefully provide more diagnostic info when DBTransactionSizeError rollbacks are triggered. Bug: T190260 Change-Id: Ib8bea5a9ec7d3ffeaf423adb930dc6fb14314449 --- diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index d11b51b0fd..dc3260d4d4 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -3844,9 +3844,11 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $this->assertOpen(); $this->runOnTransactionPreCommitCallbacks(); + $writeTime = $this->pendingWriteQueryDuration( self::ESTIMATE_DB_APPLY ); $this->doCommit( $fname ); $this->trxStatus = self::STATUS_TRX_NONE; + if ( $this->trxDoneWrites ) { $this->lastWriteTime = microtime( true ); $this->trxProfiler->transactionWritingOut( @@ -3894,14 +3896,18 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware // Avoid fatals if close() was called $this->assertOpen(); + $writeTime = $this->pendingWriteQueryDuration( self::ESTIMATE_DB_APPLY ); $this->doRollback( $fname ); $this->trxStatus = self::STATUS_TRX_NONE; $this->trxAtomicLevels = []; + if ( $this->trxDoneWrites ) { $this->trxProfiler->transactionWritingOut( $this->server, $this->dbName, - $this->trxShortId + $this->trxShortId, + $writeTime, + $this->trxWriteAffectedRows ); } }