MediaWiki
REL1_22
|
Version of LockManager based on using named/row DB 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 $pathsByType) | |
Get a connection to a lock server and release locks on $paths. | |
getConnection ($lockDb) | |
Get (or reuse) a connection to a lock DB. | |
getLocksOnServer ($lockSrv, array $pathsByType) | |
Get a connection to a lock server and acquire locks. | |
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) | |
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 named/row DB locks.
This is meant for multi-wiki systems that may share files.
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 39 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 227 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 195 of file DBLockManager.php.
DBLockManager::cacheRecordFailure | ( | $ | lockDb | ) | [protected] |
Log a lock request failure to the cache.
$lockDb | string |
Definition at line 207 of file DBLockManager.php.
DBLockManager::freeLocksOnServer | ( | $ | lockSrv, |
array $ | pathsByType | ||
) | [protected] |
Get a connection to a lock server and release locks on $paths.
Subclasses must effectively implement this or releaseAllLocks().
$lockSrv | string | |
array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Reimplemented from QuorumLockManager.
Definition at line 119 of file DBLockManager.php.
DBLockManager::getConnection | ( | $ | lockDb | ) | [protected] |
Get (or reuse) a connection to a lock DB.
$lockDb | string |
DBError |
Definition at line 147 of file DBLockManager.php.
DBLockManager::getLocksOnServer | ( | $ | lockSrv, |
array $ | pathsByType | ||
) | [protected] |
Get a connection to a lock server and acquire locks.
$lockSrv | string | |
array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Reimplemented from QuorumLockManager.
Definition at line 111 of file DBLockManager.php.
DBLockManager::getMissKey | ( | $ | lockDb | ) | [protected] |
Get a cache key for recent query misses for a DB.
$lockDb | string |
Definition at line 219 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 186 of file DBLockManager.php.
DBLockManager::isServerUp | ( | $ | lockSrv | ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 127 of file DBLockManager.php.
Array DBLockManager::$conns = array() [protected] |
Map Database connections (DB name => Database) *.
Definition at line 47 of file DBLockManager.php.
Array DBLockManager::$dbServers [protected] |
Map of DB names to server config *.
Definition at line 40 of file DBLockManager.php.
DBLockManager::$lockExpiry [protected] |
Definition at line 43 of file DBLockManager.php.
DBLockManager::$safeDelay [protected] |
Definition at line 44 of file DBLockManager.php.
DBLockManager::$session = 0 [protected] |
Definition at line 46 of file DBLockManager.php.
BagOStuff DBLockManager::$statusCache [protected] |
*
Definition at line 41 of file DBLockManager.php.