jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378093 )
Change subject: rdbms: Group disconnect/reconnect errors by DB server name ...................................................................... rdbms: Group disconnect/reconnect errors by DB server name Still allow varying on stacktrace, as those are interesting Change-Id: I62bc3f68fcbe43532dce849d515a5e0620fba6f2 --- M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/loadbalancer/LoadBalancer.php 2 files changed, 15 insertions(+), 9 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index c04e167..a9dd074 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -945,10 +945,12 @@ # Update state tracking to reflect transaction loss due to disconnection $this->handleSessionLoss(); if ( $this->reconnect() ) { - $msg = __METHOD__ . ": lost connection to {$this->getServer()}; reconnected"; - $this->connLogger->warning( $msg ); + $msg = __METHOD__ . ': lost connection to {dbserver}; reconnected'; + $params = [ 'dbserver' => $this->getServer() ]; + $this->connLogger->warning( $msg, $params ); $this->queryLogger->warning( - "$msg:\n" . ( new RuntimeException() )->getTraceAsString() ); + "$msg:\n" . ( new RuntimeException() )->getTraceAsString(), + $params ); if ( !$recoverable ) { # Callers may catch the exception and continue to use the DB @@ -958,8 +960,8 @@ $ret = $this->doProfiledQuery( $sql, $commentedSql, $isNonTempWrite, $fname ); } } else { - $msg = __METHOD__ . ": lost connection to {$this->getServer()} permanently"; - $this->connLogger->error( $msg ); + $msg = __METHOD__ . ': lost connection to {dbserver} permanently'; + $this->connLogger->error( $msg, [ 'dbserver' => $this->getServer() ] ); } } diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 8393e2b..1be8926 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -568,7 +568,8 @@ $knownReachedPos->hasReached( $this->mWaitForPos ) ) { $this->replLogger->debug( __METHOD__ . - ": replica DB $server known to be caught up (pos >= $knownReachedPos)." ); + ': replica DB {dbserver} known to be caught up (pos >= $knownReachedPos).', + [ 'dbserver' => $server ] ); return true; } @@ -576,13 +577,15 @@ $conn = $this->getAnyOpenConnection( $index ); if ( !$conn ) { if ( !$open ) { - $this->replLogger->debug( __METHOD__ . ": no connection open for $server" ); + $this->replLogger->debug( __METHOD__ . ': no connection open for {dbserver}', + [ 'dbserver' => $server ] ); return false; } else { $conn = $this->openConnection( $index, self::DOMAIN_ANY ); if ( !$conn ) { - $this->replLogger->warning( __METHOD__ . ": failed to connect to $server" ); + $this->replLogger->warning( __METHOD__ . ': failed to connect to {dbserver}', + [ 'dbserver' => $server ] ); return false; } @@ -592,7 +595,8 @@ } } - $this->replLogger->info( __METHOD__ . ": Waiting for replica DB $server to catch up..." ); + $this->replLogger->info( __METHOD__ . ': Waiting for replica DB {dbserver} to catch up...', + [ 'dbserver' => $server ] ); $timeout = $timeout ?: $this->mWaitTimeout; $result = $conn->masterPosWait( $this->mWaitForPos, $timeout ); -- To view, visit https://gerrit.wikimedia.org/r/378093 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62bc3f68fcbe43532dce849d515a5e0620fba6f2 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits