rdbms: ignore inactive mysql GTIDs in replication position methods
[lhc/web/wiklou.git] / includes / libs / rdbms / database / position / MySQLMasterPos.php
index 38f2bd6..54eca79 100644 (file)
@@ -288,7 +288,13 @@ class MySQLMasterPos implements DBMasterPos {
        }
 
        public function serialize() {
-               return serialize( [ 'position' => $this->__toString(), 'asOfTime' => $this->asOfTime ] );
+               return serialize( [
+                       'position' => $this->__toString(),
+                       'activeDomain' => $this->activeDomain,
+                       'activeServerId' => $this->activeServerId,
+                       'activeServerUUID' => $this->activeServerUUID,
+                       'asOfTime' => $this->asOfTime
+               ] );
        }
 
        public function unserialize( $serialized ) {
@@ -298,6 +304,15 @@ class MySQLMasterPos implements DBMasterPos {
                }
 
                $this->init( $data['position'], $data['asOfTime'] );
+               if ( isset( $data['activeDomain'] ) ) {
+                       $this->setActiveDomain( $data['activeDomain'] );
+               }
+               if ( isset( $data['activeServerId'] ) ) {
+                       $this->setActiveOriginServerId( $data['activeServerId'] );
+               }
+               if ( isset( $data['activeServerUUID'] ) ) {
+                       $this->setActiveOriginServerUUID( $data['activeServerUUID'] );
+               }
        }
 
        /**