ILoadBalancer: Rename finalizeMasterChanged() to finalizePrimaryChanges()
Bug: T282894 Change-Id: Ic863ee6ec1d6e6488db77dd697ac7422d105f3ca
This commit is contained in:
parent
1d71fd91d6
commit
8eb07a8ef4
5 changed files with 31 additions and 14 deletions
|
|
@ -416,14 +416,18 @@ because of Phabricator reports.
|
|||
Use getPage() and setPage() instead.
|
||||
* Title::isWatchable() has been deprecated. Use WatchlistManager::isWatchable()
|
||||
instead.
|
||||
* The 'getMasterDB()' methods for LocalRepo (and so ForeignDBRepo), JobQueueDB,
|
||||
ForeignDBViaLBRepo, and DBFileJournal have been deprecated in favour of a new
|
||||
method, getPrimaryDB().
|
||||
* DBMasterPos and MySQLMasterPos have been respectively renamed to DBPrimaryPos
|
||||
and MySQLPrimaryPos. The former names are left as deprecated, temporary class
|
||||
aliases.
|
||||
* ILoadBalancer::getMasterPos() and IDatabase::getMasterPos() have been renamed
|
||||
to getPrimaryPos(). The old name is still available, but soft-deprecated.
|
||||
* Methods and classes related to the primary database, previously referred to as
|
||||
'master', have been deprecated, with the new ones replacing them as follows:
|
||||
- The DBMasterPos and MySQLMasterPos classes have been respectively renamed to
|
||||
DBPrimaryPos and MySQLPrimaryPos.
|
||||
- LocalRepo::getMasterDB() -> ::getPrimaryDB()
|
||||
- ForeignDBRepo::getMasterDB() -> ::getPrimaryDB()
|
||||
- JobQueueDB::getMasterDB() -> ::getPrimaryDB()
|
||||
- ForeignDBViaLBRepo::getMasterDB() -> ::getPrimaryDB()
|
||||
- DBFileJournal::getMasterDB() -> ::getPrimaryDB()
|
||||
- ILoadBalancer::getMasterPos() -> ::getPrimaryPos()
|
||||
- IDatabase::getMasterPos() -> ::getPrimaryPos()
|
||||
- ILoadBalancer::finalizeMasterChanges() -> ::finalizePrimaryChanges()
|
||||
* wfIncrStats(), deprecated in 1.36, now emits deprecation warnings.
|
||||
* wfCanIPUseHTTPS() is now deprecated, and always returns true.
|
||||
* The UserLoadFromDatabase hook has been deprecated. It had no known uses.
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ abstract class LBFactory implements ILBFactory {
|
|||
do {
|
||||
$count = 0; // number of callbacks executed this iteration
|
||||
$this->forEachLB( function ( ILoadBalancer $lb ) use ( &$count, $fname ) {
|
||||
$count += $lb->finalizeMasterChanges( $fname, $this->id );
|
||||
$count += $lb->finalizePrimaryChanges( $fname, $this->id );
|
||||
} );
|
||||
} while ( $count > 0 );
|
||||
$this->trxRoundId = false;
|
||||
|
|
|
|||
|
|
@ -589,6 +589,14 @@ interface ILoadBalancer {
|
|||
* @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
|
||||
* @return int Number of pre-commit callbacks run (since 1.32)
|
||||
*/
|
||||
public function finalizePrimaryChanges( $fname = __METHOD__, $owner = null );
|
||||
|
||||
/**
|
||||
* @deprecated since 1.37; please use finalizePrimaryChanges() instead.
|
||||
* @param string $fname Caller name
|
||||
* @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
|
||||
* @return int Number of pre-commit callbacks run (since 1.32)
|
||||
*/
|
||||
public function finalizeMasterChanges( $fname = __METHOD__, $owner = null );
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1701,7 +1701,7 @@ class LoadBalancer implements ILoadBalancer {
|
|||
$this->flushReplicaSnapshots( $fname, $owner );
|
||||
}
|
||||
|
||||
public function finalizeMasterChanges( $fname = __METHOD__, $owner = null ) {
|
||||
public function finalizePrimaryChanges( $fname = __METHOD__, $owner = null ) {
|
||||
$this->assertOwnership( $fname, $owner );
|
||||
$this->assertTransactionRoundStage( [ self::ROUND_CURSORY, self::ROUND_FINALIZED ] );
|
||||
if ( $this->ownerId === null ) {
|
||||
|
|
@ -1730,6 +1730,11 @@ class LoadBalancer implements ILoadBalancer {
|
|||
return $total;
|
||||
}
|
||||
|
||||
public function finalizeMasterChanges( $fname = __METHOD__, $owner = null ) {
|
||||
// wfDeprecated( __METHOD__, '1.37' );
|
||||
return $this->finalizePrimaryChanges( $fname, $owner );
|
||||
}
|
||||
|
||||
public function approveMasterChanges( array $options, $fname = __METHOD__, $owner = null ) {
|
||||
$this->assertOwnership( $fname, $owner );
|
||||
$this->assertTransactionRoundStage( self::ROUND_FINALIZED );
|
||||
|
|
@ -1811,7 +1816,7 @@ class LoadBalancer implements ILoadBalancer {
|
|||
$this->trxRoundId = false;
|
||||
$this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
|
||||
// Commit any writes and clear any snapshots as well (callbacks require AUTOCOMMIT).
|
||||
// Note that callbacks should already be suppressed due to finalizeMasterChanges().
|
||||
// Note that callbacks should already be suppressed due to finalizePrimaryChanges().
|
||||
$this->forEachOpenMasterConnection(
|
||||
function ( IDatabase $conn ) use ( $fname, &$failures ) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ class LoadBalancerTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \Wikimedia\Rdbms\LoadBalancer::forEachOpenMasterConnection()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::setTransactionListener()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::beginMasterChanges()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::finalizeMasterChanges()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::finalizePrimaryChanges()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::approveMasterChanges()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::commitMasterChanges()
|
||||
* @covers \Wikimedia\Rdbms\LoadBalancer::runMasterTransactionIdleCallbacks()
|
||||
|
|
@ -552,7 +552,7 @@ class LoadBalancerTest extends MediaWikiIntegrationTestCase {
|
|||
} );
|
||||
} );
|
||||
} );
|
||||
$lb->finalizeMasterChanges();
|
||||
$lb->finalizePrimaryChanges();
|
||||
$lb->approveMasterChanges( [] );
|
||||
$lb->commitMasterChanges( __METHOD__ );
|
||||
$lb->runMasterTransactionIdleCallbacks();
|
||||
|
|
@ -576,7 +576,7 @@ class LoadBalancerTest extends MediaWikiIntegrationTestCase {
|
|||
} );
|
||||
} );
|
||||
} );
|
||||
$lb->finalizeMasterChanges();
|
||||
$lb->finalizePrimaryChanges();
|
||||
$lb->approveMasterChanges( [] );
|
||||
$lb->commitMasterChanges( __METHOD__ );
|
||||
$lb->runMasterTransactionIdleCallbacks();
|
||||
|
|
|
|||
Loading…
Reference in a new issue