LoadMonitor: Avoid "host not replicating?" log messages by checking "is static"
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 7 Oct 2016 22:05:22 +0000 (15:05 -0700)
committerKrinkle <krinklemail@gmail.com>
Sat, 8 Oct 2016 01:46:38 +0000 (01:46 +0000)
Change-Id: I59c47038505558b141385ea48cb62461163adb37

includes/libs/rdbms/loadmonitor/LoadMonitor.php

index 499542d..99c9126 100644 (file)
@@ -160,10 +160,14 @@ class LoadMonitor implements ILoadMonitor {
                                continue;
                        }
 
-                       $lagTimes[$i] = $conn->getLag();
-                       if ( $lagTimes[$i] === false ) {
-                               $host = $this->parent->getServerName( $i );
-                               $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                       if ( $conn->getLBInfo( 'is static' ) ) {
+                               $lagTimes[$i] = 0;
+                       } else {
+                               $lagTimes[$i] = $conn->getLag();
+                               if ( $lagTimes[$i] === false ) {
+                                       $host = $this->parent->getServerName( $i );
+                                       $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                               }
                        }
 
                        if ( $close ) {