rdbms: add trace to getLagFromPtHeartbeat() log entries
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 21 Dec 2018 18:20:58 +0000 (10:20 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 21 Dec 2018 18:20:58 +0000 (10:20 -0800)
Change-Id: I677610c711443b787f7cea1be2dd9f01486b1324

includes/libs/rdbms/database/DatabaseMysqlBase.php

index eeedff7..3fcbcf9 100644 (file)
@@ -27,6 +27,7 @@ use DateTimeZone;
 use Wikimedia;
 use InvalidArgumentException;
 use Exception;
+use RuntimeException;
 use stdClass;
 
 /**
@@ -757,7 +758,11 @@ abstract class DatabaseMysqlBase extends Database {
                                // given that the isolation level will typically be REPEATABLE-READ
                                $this->queryLogger->warning(
                                        "Using cached lag value for {db_server} due to active transaction",
-                                       $this->getLogContext( [ 'method' => __METHOD__, 'age' => $staleness ] )
+                                       $this->getLogContext( [
+                                               'method' => __METHOD__,
+                                               'age' => $staleness,
+                                               'trace' => ( new RuntimeException() )->getTraceAsString()
+                                       ] )
                                );
                        }