jenkins-bot has submitted this change and it was merged.

Change subject: Clear the DBO_TRX flag for sanity in ExternalStore
......................................................................


Clear the DBO_TRX flag for sanity in ExternalStore

* This avoids an explicit commit of an implicit transaction when the site
  config for the ES cluster does not clear that flag by mistake.

Change-Id: I57d8b04cbf3249849db1643fc82673e9de8ea15b
---
M includes/externalstore/ExternalStoreDB.php
1 file changed, 12 insertions(+), 5 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/externalstore/ExternalStoreDB.php 
b/includes/externalstore/ExternalStoreDB.php
index 5774a24..952bf63 100644
--- a/includes/externalstore/ExternalStoreDB.php
+++ b/includes/externalstore/ExternalStoreDB.php
@@ -96,9 +96,6 @@
                if ( !$id ) {
                        throw new MWException( __METHOD__ . ': no insert ID' );
                }
-               if ( $dbw->getFlag( DBO_TRX ) ) {
-                       $dbw->commit( __METHOD__ );
-               }
 
                return "DB://$cluster/$id";
        }
@@ -134,7 +131,10 @@
                        wfDebug( "writable external store\n" );
                }
 
-               return $lb->getConnection( DB_SLAVE, array(), $wiki );
+               $db = $lb->getConnection( DB_SLAVE, array(), $wiki );
+               $db->clearFlag( DBO_TRX ); // sanity
+
+               return $db;
        }
 
        /**
@@ -147,7 +147,10 @@
                $wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] 
: false;
                $lb = $this->getLoadBalancer( $cluster );
 
-               return $lb->getConnection( DB_MASTER, array(), $wiki );
+               $db = $lb->getConnection( DB_MASTER, array(), $wiki );
+               $db->clearFlag( DBO_TRX ); // sanity
+
+               return $db;
        }
 
        /**
@@ -282,6 +285,10 @@
                }
        }
 
+       /**
+        * @param string $url
+        * @return array
+        */
        protected function parseURL( $url ) {
                $path = explode( '/', $url );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I57d8b04cbf3249849db1643fc82673e9de8ea15b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to