diff options
author | Aaron Schulz <aschulz@wikimedia.org> | 2013-02-01 10:29:10 -0800 |
---|---|---|
committer | Aaron Schulz <aschulz@wikimedia.org> | 2013-02-01 10:40:45 -0800 |
commit | a4f27a198ffbcf93fce5371cd905cdd704f22c5c (patch) | |
tree | aaaac5c3d168b2984ddf63034acd5df0216aa768 /includes/filebackend/lockmanager/DBLockManager.php | |
parent | ef0e671fed5936b1a85e6a6d400a5c6ba7d1399c (diff) | |
download | mediawikicore-a4f27a198ffbcf93fce5371cd905cdd704f22c5c.tar.gz mediawikicore-a4f27a198ffbcf93fce5371cd905cdd704f22c5c.zip |
[LockManager] Generallized wiki field to a domain field.
* In some cases (like certain qualified file backends), a domain
may be desired that is not simple a wiki ID.
* Also added a LockManangerGroup::config() function to export
the configuration of a lock manager.
Change-Id: I5a75c55be3cc9017ed8a717d6d30e466fd00340f
Diffstat (limited to 'includes/filebackend/lockmanager/DBLockManager.php')
-rw-r--r-- | includes/filebackend/lockmanager/DBLockManager.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/filebackend/lockmanager/DBLockManager.php b/includes/filebackend/lockmanager/DBLockManager.php index 8196d5b8f4a4..7b365c1b15f0 100644 --- a/includes/filebackend/lockmanager/DBLockManager.php +++ b/includes/filebackend/lockmanager/DBLockManager.php @@ -22,7 +22,8 @@ */ /** - * Version of LockManager based on using DB table locks. + * Version of LockManager based on using DB table row locks. + * * This is meant for multi-wiki systems that may share files. * All locks are blocking, so it might be useful to set a small * lock-wait timeout via server config to curtail deadlocks. @@ -67,6 +68,7 @@ class DBLockManager extends QuorumLockManager { * each having an odd-numbered list of DB names (peers) as values. * Any DB named 'localDBMaster' will automatically use the DB master * settings for this wiki (without the need for a dbServers entry). + * Only use 'localDBMaster' if the domain is a valid wiki ID. * - lockExpiry : Lock timeout (seconds) for dropped connections. [optional] * This tells the DB server how long to wait before assuming * connection failure and releasing all the locks for a session. @@ -197,8 +199,8 @@ class DBLockManager extends QuorumLockManager { if ( !isset( $this->conns[$lockDb] ) ) { $db = null; if ( $lockDb === 'localDBMaster' ) { - $lb = wfGetLBFactory()->getMainLB( $this->wiki ); - $db = $lb->getConnection( DB_MASTER, array(), $this->wiki ); + $lb = wfGetLBFactory()->getMainLB( $this->domain ); + $db = $lb->getConnection( DB_MASTER, array(), $this->domain ); } elseif ( isset( $this->dbServers[$lockDb] ) ) { $config = $this->dbServers[$lockDb]; $db = DatabaseBase::factory( $config['type'], $config ); |