|
MediaWiki
REL1_20
|
Version of LockManager based on using DB table locks. More...


Public Member Functions | |
| __construct (array $config) | |
| Construct a new instance from configuration. | |
| __destruct () | |
| Make sure remaining locks get cleared for sanity. | |
Protected Member Functions | |
| cacheCheckFailures ($lockDb) | |
| Checks if the DB has not recently had connection/query errors. | |
| cacheRecordFailure ($lockDb) | |
| Log a lock request failure to the cache. | |
| freeLocksOnServer ($lockSrv, array $paths, $type) | |
| getConnection ($lockDb) | |
| Get (or reuse) a connection to a lock DB. | |
| getLocksOnServer ($lockSrv, array $paths, $type) | |
| Get a connection to a lock DB and acquire locks on $paths. | |
| getMissKey ($lockDb) | |
| Get a cache key for recent query misses for a DB. | |
| initConnection ($lockDb, DatabaseBase $db) | |
| Do additional initialization for new lock DB connection. | |
| isServerUp ($lockSrv) | |
| releaseAllLocks () | |
Protected Attributes | |
| Array | $conns = array() |
| Map Database connections (DB name => Database) *. | |
| Array | $dbServers |
| Map of DB names to server config *. | |
| $lockExpiry | |
| $safeDelay | |
| $session = 0 | |
| BagOStuff | $statusCache |
| * | |
Version of LockManager based on using DB table 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.
All lock requests for a resource, identified by a hash string, will map to one bucket. Each bucket maps to one or several peer DBs, each on their own server, all having the filelocks.sql tables (with row-level locking). A majority of peer DBs must agree for a lock to be acquired.
Caching is used to avoid hitting servers that are down.
Definition at line 40 of file DBLockManager.php.
| DBLockManager::__construct | ( | array $ | config | ) |
Construct a new instance from configuration.
$config paramaters include:
| Array | $config |
Reimplemented from LockManager.
Definition at line 73 of file DBLockManager.php.
Make sure remaining locks get cleared for sanity.
Definition at line 273 of file DBLockManager.php.
| DBLockManager::cacheCheckFailures | ( | $ | lockDb | ) | [protected] |
Checks if the DB has not recently had connection/query errors.
This just avoids wasting time on doomed connection attempts.
| $lockDb | string |
Definition at line 241 of file DBLockManager.php.
| DBLockManager::cacheRecordFailure | ( | $ | lockDb | ) | [protected] |
Log a lock request failure to the cache.
| $lockDb | string |
Definition at line 253 of file DBLockManager.php.
| DBLockManager::freeLocksOnServer | ( | $ | lockSrv, |
| array $ | paths, | ||
| $ | type | ||
| ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 145 of file DBLockManager.php.
| DBLockManager::getConnection | ( | $ | lockDb | ) | [protected] |
Get (or reuse) a connection to a lock DB.
| $lockDb | string |
| DBError |
Definition at line 193 of file DBLockManager.php.
| DBLockManager::getLocksOnServer | ( | $ | lockSrv, |
| array $ | paths, | ||
| $ | type | ||
| ) | [protected] |
Get a connection to a lock DB and acquire locks on $paths.
This does not use GET_LOCK() per http://bugs.mysql.com/bug.php?id=1118.
Reimplemented from QuorumLockManager.
Reimplemented in MySqlLockManager.
Definition at line 117 of file DBLockManager.php.
| DBLockManager::getMissKey | ( | $ | lockDb | ) | [protected] |
Get a cache key for recent query misses for a DB.
| $lockDb | string |
Definition at line 265 of file DBLockManager.php.
| DBLockManager::initConnection | ( | $ | lockDb, |
| DatabaseBase $ | db | ||
| ) | [protected] |
Do additional initialization for new lock DB connection.
| $lockDb | string |
| $db | DatabaseBase |
| DBError |
Reimplemented in MySqlLockManager.
Definition at line 232 of file DBLockManager.php.
| DBLockManager::isServerUp | ( | $ | lockSrv | ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 173 of file DBLockManager.php.
| DBLockManager::releaseAllLocks | ( | ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 153 of file DBLockManager.php.
Array DBLockManager::$conns = array() [protected] |
Map Database connections (DB name => Database) *.
Definition at line 48 of file DBLockManager.php.
Array DBLockManager::$dbServers [protected] |
Map of DB names to server config *.
Definition at line 41 of file DBLockManager.php.
DBLockManager::$lockExpiry [protected] |
Definition at line 44 of file DBLockManager.php.
DBLockManager::$safeDelay [protected] |
Definition at line 45 of file DBLockManager.php.
DBLockManager::$session = 0 [protected] |
Definition at line 47 of file DBLockManager.php.
BagOStuff DBLockManager::$statusCache [protected] |
*
Definition at line 42 of file DBLockManager.php.