Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312435

Change subject: Call setTransactionTicket() on DeferredUpdates sub-queue items 
too
......................................................................

Call setTransactionTicket() on DeferredUpdates sub-queue items too

This should lower the rate of "does not have outer scope" log
warnings in DBPerformance.

Also add traces to such logs.

Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
---
M includes/deferred/DeferredUpdates.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/312435/1

diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d24ebde..8a761f5 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -214,6 +214,10 @@
                                                $firstKey = key( 
self::$executeContext['subqueue'] );
                                                unset( 
self::$executeContext['subqueue'][$firstKey] );
 
+                                               if ( $subUpdate instanceof 
DataUpdate ) {
+                                                       
$subUpdate->setTransactionTicket( $ticket );
+                                               }
+
                                                $guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
                                                $reportableError = 
$reportableError ?: $guiError;
                                        }
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index cf9a298..f584865 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -515,7 +515,9 @@
         */
        public function getEmptyTransactionTicket( $fname ) {
                if ( $this->hasMasterChanges() ) {
-                       $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+                       $this->queryLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+                               ( new RuntimeException() )->getTraceAsString() 
);
+
                        return null;
                }
 
@@ -535,7 +537,9 @@
         */
        public function commitAndWaitForReplication( $fname, $ticket, array 
$opts = [] ) {
                if ( $ticket !== $this->ticket ) {
-                       $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope." );
+                       $this->perfLogger->error( __METHOD__ . ": $fname does 
not have outer scope.\n" .
+                               ( new RuntimeException() )->getTraceAsString() 
);
+
                        return;
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/312435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d21ea745cae07e0fbbe4cd8de82e93f1d10e0a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to