50 if (
$lb->getServerCount() <= 1 ) {
53 if ( !$this->initialized ) {
54 $this->initialized =
true;
55 if ( isset( $_SESSION[__CLASS__] ) && is_array( $_SESSION[__CLASS__] ) ) {
56 $this->startupPositions = $_SESSION[__CLASS__];
59 $masterName =
$lb->getServerName( 0 );
60 if ( !empty( $this->startupPositions[$masterName] ) ) {
61 $info =
$lb->parentInfo();
62 $pos = $this->startupPositions[$masterName];
63 wfDebug( __METHOD__ .
": LB " . $info[
'id'] .
" waiting for master pos $pos\n" );
76 if ( session_id() ==
'' ||
$lb->getServerCount() <= 1 ) {
79 $masterName =
$lb->getServerName( 0 );
80 if ( isset( $this->shutdownPositions[$masterName] ) ) {
84 $db =
$lb->getAnyOpenConnection( 0 );
85 $info =
$lb->parentInfo();
86 if ( !$db || !$db->doneWrites() ) {
87 wfDebug( __METHOD__ .
": LB {$info['id']}, no writes done\n" );
91 $pos = $db->getMasterPos();
92 wfDebug( __METHOD__ .
": LB {$info['id']} has master pos $pos\n" );
93 $this->shutdownPositions[$masterName] = $pos;
103 if ( session_id() !=
'' && count( $this->shutdownPositions ) ) {
104 wfDebug( __METHOD__ .
": saving master pos for " .
105 count( $this->shutdownPositions ) .
" master(s)\n" );