|
MediaWiki
REL1_23
|
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.
| array | $config | Paramaters include:
|
Reimplemented from LockManager.
Definition at line 71 of file DBLockManager.php.
Make sure remaining locks get cleared for sanity.
Definition at line 230 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 198 of file DBLockManager.php.
| DBLockManager::cacheRecordFailure | ( | $ | lockDb | ) | [protected] |
Log a lock request failure to the cache.
| string | $lockDb |
Definition at line 210 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().
| string | $lockSrv | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Reimplemented from QuorumLockManager.
Definition at line 118 of file DBLockManager.php.
| DBLockManager::getConnection | ( | $ | lockDb | ) | [protected] |
Get (or reuse) a connection to a lock DB.
| string | $lockDb |
| DBError |
Definition at line 149 of file DBLockManager.php.
| DBLockManager::getLocksOnServer | ( | $ | lockSrv, |
| array $ | pathsByType | ||
| ) | [protected] |
Get a connection to a lock server and acquire locks.
| string | $lockSrv | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Reimplemented from QuorumLockManager.
Definition at line 109 of file DBLockManager.php.
| DBLockManager::getMissKey | ( | $ | lockDb | ) | [protected] |
Get a cache key for recent query misses for a DB.
| string | $lockDb |
Definition at line 222 of file DBLockManager.php.
| DBLockManager::initConnection | ( | $ | lockDb, |
| DatabaseBase $ | db | ||
| ) | [protected] |
Do additional initialization for new lock DB connection.
| string | $lockDb | |
| DatabaseBase | $db |
| DBError |
Reimplemented in MySqlLockManager.
Definition at line 188 of file DBLockManager.php.
| DBLockManager::isServerUp | ( | $ | lockSrv | ) | [protected] |
| string | $lockSrv |
Reimplemented from QuorumLockManager.
Definition at line 127 of file DBLockManager.php.
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.