* (bug 20699) API watchlist should list log-events
* (bug 29070) Add token to action=watch
* (bug 29221) Expose oldrevid in watchlist output
+* (bug 29267) always give the servername for meta=siteinfo&siprop=dbrepllag
=== Languages updated in 1.19 ===
protected function appendDbReplLagInfo( $property, $includeAll ) {
global $wgShowHostnames;
$data = array();
+ $lb = wfGetLB();
if ( $includeAll ) {
if ( !$wgShowHostnames ) {
$this->dieUsage( 'Cannot view all servers info unless $wgShowHostnames is true', 'includeAllDenied' );
}
- $lb = wfGetLB();
$lags = $lb->getLagTimes();
foreach ( $lags as $i => $lag ) {
$data[] = array(
);
}
} else {
- list( $host, $lag ) = wfGetLB()->getMaxLag();
+ list( $host, $lag, $index ) = $lb->getMaxLag();
$data[] = array(
- 'host' => $wgShowHostnames ? $host : '',
+ 'host' => $wgShowHostnames
+ ? $lb->getServerName( $index )
+ : '',
'lag' => intval( $lag )
);
}
* This is useful for maintenance scripts that need to throttle their updates.
* May attempt to open connections to slaves on the default DB.
* @param $wiki string Wiki ID, or false for the default database
+ *
+ * @return array ( host, max lag, index of max lagged host )
*/
function getMaxLag( $wiki = false ) {
$maxLag = -1;
$host = '';
+ $maxIndex = 0;
foreach ( $this->mServers as $i => $conn ) {
$conn = false;
if ( $wiki === false ) {
if ( $lag > $maxLag ) {
$maxLag = $lag;
$host = $this->mServers[$i]['host'];
+ $maxIndex = $i;
}
}
- return array( $host, $maxLag );
+ return array( $host, $maxLag, $maxIndex );
}
/**