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) | ||||
getTopologyBasedServerId (IDatabase $conn) | ||||
| ||||
primaryPosWait (IDatabase $conn, DBPrimaryPos $pos, $timeout) | ||||
![]() | ||||
__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=__METHOD__) | |
getServerId (IDatabase $conn) | |
getServerRoleStatus (IDatabase $conn, $role, $fname=__METHOD__) | |
getServerUUID (IDatabase $conn) | |
useGTIDs () | |
![]() | |
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 | |
![]() | |
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 53 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 67 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 142 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 164 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\getServerName().
|
protected |
IDatabase | $conn | To make queries |
Definition at line 100 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 79 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 358 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 327 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 | ) |
IDatabase | $conn | To make queries |
Definition at line 186 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\selectRow().
|
protected |
IDatabase | $conn | To make queries |
string | $fname |
Definition at line 445 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 406 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\IReadableDatabase\getServerName(), and Wikimedia\Rdbms\IDatabase\query().
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getPrimaryPos(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getTopologyBasedServerId().
|
protected |
IDatabase | $conn | To make queries |
string | $role | One of "MASTER"/"SLAVE" |
string | $fname |
Definition at line 470 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 425 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::getTopologyBasedServerId | ( | IDatabase | $conn | ) |
IDatabase | $conn | To make queries |
IDatabase | $conn | To make queries |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 397 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getServerId().
Wikimedia\Rdbms\Replication\MysqlReplicationReporter::primaryPosWait | ( | IDatabase | $conn, |
DBPrimaryPos | $pos, | ||
$timeout | |||
) |
Reimplemented from Wikimedia\Rdbms\Replication\ReplicationReporter.
Definition at line 208 of file MysqlReplicationReporter.php.
References Wikimedia\Rdbms\DBPrimaryPos\__toString(), Wikimedia\Rdbms\Database\DbQuoter\addQuotes(), Wikimedia\Rdbms\Replication\ReplicationReporter\getLogContext(), Wikimedia\Rdbms\Replication\MysqlReplicationReporter\getReplicaPos(), and Wikimedia\Rdbms\IDatabase\query().
|
protected |
Definition at line 204 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 40 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct().
|
protected |
Method to detect replica DB lag.
Definition at line 42 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct().
|
protected |
Definition at line 38 of file MysqlReplicationReporter.php.
|
protected |
bool Whether to use GTID methods
Definition at line 44 of file MysqlReplicationReporter.php.
Referenced by Wikimedia\Rdbms\Replication\MysqlReplicationReporter\__construct(), and Wikimedia\Rdbms\Replication\MysqlReplicationReporter\useGTIDs().