From: jenkins-bot Date: Fri, 18 Aug 2017 01:38:01 +0000 (+0000) Subject: Merge "rdbms: Support secondary autocommit connections in LoadBalancer" X-Git-Tag: 1.31.0-rc.0~2367 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=3ebc79c08a9832e26147d5b27967ca9668b80328;hp=99c80a8fc7bb4d434ab5fad2d0ca404716d8f8db;p=lhc%2Fweb%2Fwiklou.git Merge "rdbms: Support secondary autocommit connections in LoadBalancer" --- diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 991e0c6660..692ddb70b8 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -778,6 +778,8 @@ abstract class DatabaseMysqlBase extends Database { * @see https://www.percona.com/doc/percona-toolkit/2.1/pt-heartbeat.html */ protected function getHeartbeatData( array $conds ) { + // Query time and trip time are not counted + $nowUnix = microtime( true ); // Do not bother starting implicit transactions here $this->clearFlag( self::DBO_TRX, self::REMEMBER_PRIOR ); try { @@ -793,7 +795,7 @@ abstract class DatabaseMysqlBase extends Database { $this->restoreFlags(); } - return [ $row ? $row->ts : null, microtime( true ) ]; + return [ $row ? $row->ts : null, $nowUnix ]; } protected function getApproximateLagStatus() { diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index f64cd56f64..1665a5ef7d 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -1208,7 +1208,7 @@ class LoadBalancer implements ILoadBalancer { if ( $limit > 0 && $time > $limit ) { throw new DBTransactionSizeError( $conn, - "Transaction spent $time second(s) in writes, exceeding the $limit limit.", + "Transaction spent $time second(s) in writes, exceeding the limit of $limit.", [ $time, $limit ] ); } diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 6a7971435a..e3b73a98b0 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -494,17 +494,22 @@ class SpecialNewpages extends IncludableSpecialPage { } protected function feedItemDesc( $row ) { - $revision = $this->revisionFromRcResult( $row ); - if ( $revision ) { - // XXX: include content model/type in feed item? - return '

' . htmlspecialchars( $revision->getUserText() ) . - $this->msg( 'colon-separator' )->inContentLanguage()->escaped() . - htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . - "

\n
\n
" . - nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "
"; + $revision = Revision::newFromId( $row->rev_id ); + if ( !$revision ) { + return ''; } - return ''; + $content = $revision->getContent(); + if ( $content === null ) { + return ''; + } + + // XXX: include content model/type in feed item? + return '

' . htmlspecialchars( $revision->getUserText() ) . + $this->msg( 'colon-separator' )->inContentLanguage()->escaped() . + htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . + "

\n
\n
" . + nl2br( htmlspecialchars( $content->serialize() ) ) . "
"; } protected function getGroupName() {