rdbms: add more error logging to DatabaseMysqlBase::masterPosWait
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 30 Mar 2018 11:39:05 +0000 (04:39 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 30 Mar 2018 11:39:05 +0000 (04:39 -0700)
Change-Id: Ia687ddeffc9c9427c6126d8ed831fb52b38e8260

includes/libs/rdbms/database/DatabaseMysqlBase.php

index 286d658..5e06f28 100644 (file)
@@ -901,6 +901,13 @@ abstract class DatabaseMysqlBase extends Database {
                        $rpos = $this->getReplicaPos();
                        $gtidsWait = $rpos ? MySQLMasterPos::getCommonDomainGTIDs( $pos, $rpos ) : [];
                        if ( !$gtidsWait ) {
                        $rpos = $this->getReplicaPos();
                        $gtidsWait = $rpos ? MySQLMasterPos::getCommonDomainGTIDs( $pos, $rpos ) : [];
                        if ( !$gtidsWait ) {
+                               $this->queryLogger->error(
+                                       "No GTIDs with the same domain between master ($pos) and replica ($rpos)",
+                                       $this->getLogContext( [
+                                               'method' => __METHOD__,
+                                       ] )
+                               );
+
                                return -1; // $pos is from the wrong cluster?
                        }
                        // Wait on the GTID set (MariaDB only)
                                return -1; // $pos is from the wrong cluster?
                        }
                        // Wait on the GTID set (MariaDB only)