[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove Atomic methods from ConnectionManagers

2016-12-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove Atomic methods from ConnectionManagers
..


Remove Atomic methods from ConnectionManagers

Change-Id: I697f63f45975b13af52bc22fced6e4d07e35115f
Depends-On: I4341a1b4ff6a67e4c1770faae38e9b126f1bf0bf
---
M includes/libs/rdbms/connectionmanager/ConnectionManager.php
M includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
M 
tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
3 files changed, 0 insertions(+), 116 deletions(-)

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



diff --git a/includes/libs/rdbms/connectionmanager/ConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
index 6d5d8ab..4f72f77 100644
--- a/includes/libs/rdbms/connectionmanager/ConnectionManager.php
+++ b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
@@ -138,43 +138,4 @@
return $this->getConnectionRef( DB_REPLICA, $groups );
}
 
-   /**
-* Begins an atomic section and returns a database connection to the 
master DB, for updating.
-*
-* @since 1.29
-*
-* @param string $fname
-*
-* @return Database
-*/
-   public function beginAtomicSection( $fname ) {
-   $db = $this->getWriteConnection();
-   $db->startAtomic( $fname );
-
-   return $db;
-   }
-
-   /**
-* @since 1.29
-*
-* @param IDatabase $db
-* @param string $fname
-*/
-   public function commitAtomicSection( IDatabase $db, $fname ) {
-   $db->endAtomic( $fname );
-   $this->releaseConnection( $db );
-   }
-
-   /**
-* @since 1.29
-*
-* @param IDatabase $db
-* @param string $fname
-*/
-   public function rollbackAtomicSection( IDatabase $db, $fname ) {
-   // FIXME: there does not seem to be a clean way to roll back an 
atomic section?!
-   $db->rollback( $fname, 'flush' );
-   $this->releaseConnection( $db );
-   }
-
 }
diff --git 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
index 02972e5..e183823 100644
--- 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
+++ 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
@@ -37,7 +37,6 @@
/**
 * Forces all future calls to getReadConnection() to return a write 
connection.
 * Use this before performing read operations that are critical for a 
future update.
-* Calling beginAtomicSection() implies a call to prepareForUpdates().
 *
 * @since 1.29
 */
@@ -93,26 +92,6 @@
public function getWriteConnectionRef() {
$this->prepareForUpdates();
return parent::getWriteConnectionRef();
-   }
-
-   /**
-* Begins an atomic section and returns a database connection to the 
master DB, for updating.
-*
-* @since 1.29
-*
-* @note: This causes all future calls to getReadConnection() to return 
a connection
-* to the master DB, even after commitAtomicSection() or 
rollbackAtomicSection() have
-* been called.
-*
-* @param string $fname
-*
-* @return Database
-*/
-   public function beginAtomicSection( $fname ) {
-   // Once we have written to master, do not read from replica.
-   $this->prepareForUpdates();
-
-   return parent::beginAtomicSection( $fname );
}
 
 }
diff --git 
a/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
 
b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
index 4dcab82..0d54659 100644
--- 
a/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
+++ 
b/tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
@@ -105,60 +105,4 @@
$manager = new SessionConsistentConnectionManager( $lb );
$manager->releaseConnection( $database );
}
-
-   public function testBeginAtomicSection() {
-   $database = $this->getIDatabaseMock();
-   $lb = $this->getLoadBalancerMock();
-
-   $lb->expects( $this->exactly( 2 ) )
-   ->method( 'getConnection' )
-   ->with( DB_MASTER )
-   ->will( $this->returnValue( $database ) );
-
-   $database->expects( $this->once() )
-   ->method( 'startAtomic' )
-   ->will( $this->returnV

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove Atomic methods from ConnectionManagers

2016-11-30 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove Atomic methods from ConnectionManagers
..

Remove Atomic methods from ConnectionManagers

Change-Id: I697f63f45975b13af52bc22fced6e4d07e35115f
Depends-On: I4341a1b4ff6a67e4c1770faae38e9b126f1bf0bf
---
M includes/libs/rdbms/connectionmanager/ConnectionManager.php
M includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
2 files changed, 0 insertions(+), 60 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/324630/1

diff --git a/includes/libs/rdbms/connectionmanager/ConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
index 6d5d8ab..4f72f77 100644
--- a/includes/libs/rdbms/connectionmanager/ConnectionManager.php
+++ b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
@@ -138,43 +138,4 @@
return $this->getConnectionRef( DB_REPLICA, $groups );
}
 
-   /**
-* Begins an atomic section and returns a database connection to the 
master DB, for updating.
-*
-* @since 1.29
-*
-* @param string $fname
-*
-* @return Database
-*/
-   public function beginAtomicSection( $fname ) {
-   $db = $this->getWriteConnection();
-   $db->startAtomic( $fname );
-
-   return $db;
-   }
-
-   /**
-* @since 1.29
-*
-* @param IDatabase $db
-* @param string $fname
-*/
-   public function commitAtomicSection( IDatabase $db, $fname ) {
-   $db->endAtomic( $fname );
-   $this->releaseConnection( $db );
-   }
-
-   /**
-* @since 1.29
-*
-* @param IDatabase $db
-* @param string $fname
-*/
-   public function rollbackAtomicSection( IDatabase $db, $fname ) {
-   // FIXME: there does not seem to be a clean way to roll back an 
atomic section?!
-   $db->rollback( $fname, 'flush' );
-   $this->releaseConnection( $db );
-   }
-
 }
diff --git 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
index 02972e5..e183823 100644
--- 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
+++ 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
@@ -37,7 +37,6 @@
/**
 * Forces all future calls to getReadConnection() to return a write 
connection.
 * Use this before performing read operations that are critical for a 
future update.
-* Calling beginAtomicSection() implies a call to prepareForUpdates().
 *
 * @since 1.29
 */
@@ -93,26 +92,6 @@
public function getWriteConnectionRef() {
$this->prepareForUpdates();
return parent::getWriteConnectionRef();
-   }
-
-   /**
-* Begins an atomic section and returns a database connection to the 
master DB, for updating.
-*
-* @since 1.29
-*
-* @note: This causes all future calls to getReadConnection() to return 
a connection
-* to the master DB, even after commitAtomicSection() or 
rollbackAtomicSection() have
-* been called.
-*
-* @param string $fname
-*
-* @return Database
-*/
-   public function beginAtomicSection( $fname ) {
-   // Once we have written to master, do not read from replica.
-   $this->prepareForUpdates();
-
-   return parent::beginAtomicSection( $fname );
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I697f63f45975b13af52bc22fced6e4d07e35115f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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