MediaWiki master
|
Inherits Wikimedia\Rdbms\Replication\ReplicationReporter.
Public Member Functions | |
__construct ( $topologyRole, $logger, $srvCache, $lagDetectionMethod, $lagDetectionOptions, $useGTIDs) | |
getApproximateLagStatus (IDatabase $conn) | |
Get a replica DB lag estimate for this server at the start of a transaction. | |
getPrimaryPos (IDatabase $conn) | |
Get the position of the primary DB from SHOW MASTER STATUS. | |
getReplicaPos (IDatabase $conn) | |
Get the position of the primary DB from SHOW SLAVE STATUS. | |
getReplicationSafetyInfo (IDatabase $conn, $fname) | |
primaryPosWait (IDatabase $conn, DBPrimaryPos $pos, $timeout) | |
Public Member Functions inherited from Wikimedia\Rdbms\Replication\ReplicationReporter | |
__construct ( $topologyRole, $logger, $srvCache) | |
getLag (IDatabase $conn) | |
getSessionLagStatus (IDatabase $conn) | |
getTopologyBasedReadOnlyReason () | |
getTopologyRole () | |
resetReplicationLagStatus (IDatabase $conn) | |
Protected Member Functions | |
doGetLag (IDatabase $conn) | |
Get the amount of replication lag for this database server. | |
fetchSecondsSinceHeartbeat (IDatabase $conn) | |
getLagFromPtHeartbeat (IDatabase $conn) | |
getLagFromSlaveStatus (IDatabase $conn) | |
getServerGTIDs (IDatabase $conn, $fname) | |
getServerId (IDatabase $conn) | |
getServerRoleStatus (IDatabase $conn, $role, $fname) | |
getServerUUID (IDatabase $conn) | |
useGTIDs () | |
Protected Member Functions inherited from Wikimedia\Rdbms\Replication\ReplicationReporter | |
getLogContext (IDatabase $conn, array $extras=[]) | |
Create a log context to pass to PSR-3 logger functions. | |
getRecordedTransactionLagStatus (IDatabase $conn) | |
Get the replica DB lag when the current transaction started. | |
Protected Attributes | |
string | $lagDetectionMethod |
Method to detect replica DB lag. | |
array | $lagDetectionOptions = [] |
Method to detect replica DB lag. | |
MySQLPrimaryPos | $lastKnownReplicaPos |
bool | $useGTIDs = false |
bool Whether to use GTID methods | |
Protected Attributes inherited from Wikimedia\Rdbms\Replication\ReplicationReporter | |
LoggerInterface | $logger |
BagOStuff | $srvCache |
string | $topologyRole |
Replication topology role of the server; one of the class ROLE_* constants. | |
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::__construct | ( | $topologyRole, | |
$logger, | |||
$srvCache, | |||
$lagDetectionMethod, | |||
$lagDetectionOptions, | |||
$useGTIDs ) |
Definition at line 54 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\$lagDetectionMethod, Wikimedia\Rdbms\Replication\MysqlReplicationReporter\$lagDetectionOptions, Wikimedia\Rdbms\Replication\ReplicationReporter\$logger, Wikimedia\Rdbms\Replication\ReplicationReporter\$srvCache, Wikimedia\Rdbms\Replication\ReplicationReporter\$topologyRole, Wikimedia\Rdbms\Replication\MysqlReplicationReporter\$useGTIDs, and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\useGTIDs().
|
protected |
Get the amount of replication lag for this database server.
Callers should avoid using this method while a transaction is active
IDatabase | $conn | To make queries |
DBError |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 68 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getLagFromPtHeartbeat(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getLagFromSlaveStatus().
|
protected |
IDatabase | $conn | To make queries |
Definition at line 146 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Platform\ISQLPlatform\makeList(), and Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getLagFromPtHeartbeat().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::getApproximateLagStatus | ( | IDatabase | $conn | ) |
Get a replica DB lag estimate for this server at the start of a transaction.
This is a no-op unless the server is known a priori to be a replica DB
IDatabase | $conn | To make queries |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 172 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\getServerName().
|
protected |
IDatabase | $conn | To make queries |
Definition at line 104 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\fetchSecondsSinceHeartbeat(), Wikimedia\Rdbms\Replication\ReplicationReporter\getLogContext(), and Wikimedia\Rdbms\Replication\ReplicationReporter\getRecordedTransactionLagStatus().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\doGetLag().
|
protected |
IDatabase | $conn | To make queries |
Definition at line 80 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\doGetLag().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::getPrimaryPos | ( | IDatabase | $conn | ) |
Get the position of the primary DB from SHOW MASTER STATUS.
IDatabase | $conn | To make queries |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 383 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerGTIDs(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerId(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerRoleStatus(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerUUID(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\useGTIDs().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::getReplicaPos | ( | IDatabase | $conn | ) |
Get the position of the primary DB from SHOW SLAVE STATUS.
IDatabase | $conn | To make queries |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 352 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerGTIDs(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerRoleStatus(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\useGTIDs().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\primaryPosWait().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::getReplicationSafetyInfo | ( | IDatabase | $conn, |
$fname ) |
IDatabase | $conn | To make queries |
string | $fname |
Definition at line 195 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\selectRow().
|
protected |
IDatabase | $conn | To make queries |
string | $fname |
Definition at line 473 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getReplicaPos().
|
protected |
IDatabase | $conn | To make queries |
DBQueryError |
Definition at line 422 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\getServerName(), and Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos().
|
protected |
IDatabase | $conn | To make queries |
string | $role | One of "MASTER"/"SLAVE" |
string | $fname |
Definition at line 512 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getReplicaPos().
|
protected |
IDatabase | $conn | To make queries |
DBQueryError |
Definition at line 447 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\getServerName(), and Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::primaryPosWait | ( | IDatabase | $conn, |
DBPrimaryPos | $pos, | ||
$timeout ) |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 217 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\DBPrimaryPos\__toString(), Wikimedia\Rdbms\Database\DbQuoter\addQuotes(), Wikimedia\Rdbms\Replication\ReplicationReporter\getLogContext(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getReplicaPos(), Wikimedia\Rdbms\IDatabase\query(), and Wikimedia\Rdbms\IDatabase\ROLE_STATIC_CLONE.
|
protected |
Definition at line 213 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\$useGTIDs.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getReplicaPos().
|
protected |
Method to detect replica DB lag.
Definition at line 41 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct().
|
protected |
Method to detect replica DB lag.
Definition at line 43 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct().
|
protected |
Definition at line 39 of file MysqlReplicationReporter.php.
|
protected |
bool Whether to use GTID methods
Definition at line 45 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\useGTIDs().