diff --git a/mysql-test/suite/multi_source/mdev_9107.cnf b/mysql-test/suite/multi_source/mdev_9107.cnf
new file mode 100644
index 00000000000..d75f2a1ac48
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev_9107.cnf
@@ -0,0 +1,19 @@
+!include my.cnf
+
+[mysqld.1]
+log-bin
+gtid_domain_id=1
+log-slave-updates
+gtid_ignore_duplicates=1
+
+[mysqld.2]
+log-bin
+gtid_domain_id=2
+log-slave-updates
+gtid_ignore_duplicates=1
+
+[mysqld.3]
+log-bin
+gtid_domain_id=3
+log-slave-updates
+gtid_ignore_duplicates=1
diff --git a/mysql-test/suite/multi_source/mdev_9107.result b/mysql-test/suite/multi_source/mdev_9107.result
new file mode 100644
index 00000000000..ba753ac4d33
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev_9107.result
@@ -0,0 +1,130 @@
+#Server 1
+#
+change master 'm2_s1' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+change master 'm3_s1' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+start slave "m2_s1";
+set default_master_connection = 'm2_s1';
+include/wait_for_slave_to_start.inc
+start slave "m3_s1";
+set default_master_connection = 'm2_s1';
+include/wait_for_slave_to_start.inc
+#Server 3
+#
+change master 'm2_s3' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+change master 'm1_s3' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+start all slaves;
+Warnings:
+Note	1937	SLAVE 'm1_s3' started
+Note	1937	SLAVE 'm2_s3' started
+set default_master_connection = 'm2_s3';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm1_s3';
+include/wait_for_slave_to_start.inc
+#Server 2
+#
+change master 'm1_s2' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+change master 'm3_s2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+start all slaves;
+Warnings:
+Note	1937	SLAVE 'm1_s2' started
+Note	1937	SLAVE 'm3_s2' started
+set default_master_connection = 'm1_s2';
+include/wait_for_slave_to_start.inc
+set default_master_connection = 'm3_s2';
+include/wait_for_slave_to_start.inc
+#Server 2
+#
+create database d;
+use d;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+2-2-1
+select @@gtid_current_pos;
+@@gtid_current_pos
+2-2-1
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+#Server 3
+#
+use d;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+2-2-1
+select @@gtid_current_pos;
+@@gtid_current_pos
+2-2-1
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+2-2-1
+#Server 1
+#
+use d;
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+2-2-1
+select @@gtid_current_pos;
+@@gtid_current_pos
+2-2-1
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+2-2-1
+#Server 3
+#
+stop slave "m2_s3";
+SET default_master_connection = "m2_s3";
+include/wait_for_slave_to_stop.inc
+#Server 2
+#
+create table t1(a int);
+#Server 1
+#
+show tables;
+Tables_in_d
+t1
+create table t2(a int);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-1-1,2-2-2
+select @@gtid_current_pos;
+@@gtid_current_pos
+1-1-1,2-2-2
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+2-2-2
+#Server 3
+#
+show tables;
+Tables_in_d
+t1
+t2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-1-1,2-2-2
+select @@gtid_current_pos;
+@@gtid_current_pos
+1-1-1,2-2-2
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+1-1-1,2-2-2
+#Server 3
+#
+start slave "m2_s3";
+SET default_master_connection = "m2_s3";
+include/wait_for_slave_to_start.inc
+show tables;
+Tables_in_d
+t1
+t2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-1-1,2-2-2
+select @@gtid_current_pos;
+@@gtid_current_pos
+1-1-1,2-2-2
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+1-1-1,2-2-2
+#Server 2
+#
+drop database d;
diff --git a/mysql-test/suite/multi_source/mdev_9107.test b/mysql-test/suite/multi_source/mdev_9107.test
new file mode 100644
index 00000000000..1c2fa303087
--- /dev/null
+++ b/mysql-test/suite/multi_source/mdev_9107.test
@@ -0,0 +1,144 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+
+--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
+--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
+
+# Replication topology fully connected 3 master
+
+--connection server_1
+--echo #Server 1
+--echo #
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master 'm2_s1' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+--replace_result $SERVER_MYPORT_3 MYPORT_3
+eval change master 'm3_s1' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+
+start slave "m2_s1";
+set default_master_connection = 'm2_s1';
+--source include/wait_for_slave_to_start.inc
+start slave "m3_s1";
+set default_master_connection = 'm2_s1';
+--source include/wait_for_slave_to_start.inc
+
+--connection server_3
+--echo #Server 3
+--echo #
+
+--replace_result $SERVER_MYPORT_2 MYPORT_2
+eval change master 'm2_s3' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'm1_s3' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+
+start all slaves;
+set default_master_connection = 'm2_s3';
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = 'm1_s3';
+--source include/wait_for_slave_to_start.inc
+
+--connection server_2
+--echo #Server 2
+--echo #
+
+--replace_result $SERVER_MYPORT_1 MYPORT_1
+eval change master 'm1_s2' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+
+--replace_result $SERVER_MYPORT_3 MYPORT_3
+eval change master 'm3_s2' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
+
+start all slaves;
+set default_master_connection = 'm1_s2';
+--source include/wait_for_slave_to_start.inc
+set default_master_connection = 'm3_s2';
+--source include/wait_for_slave_to_start.inc
+
+
+--connection server_2
+--echo #Server 2
+--echo #
+create database d;
+use d;
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+--save_master_pos
+
+--connection server_3
+--echo #Server 3
+--echo #
+--sync_with_master 0,'m2_s3'
+--sync_with_master 0,'m1_s3'
+use d;
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+
+--connection server_1
+--echo #Server 1
+--echo #
+--sync_with_master 0,'m2_s1'
+--sync_with_master 0,'m3_s1'
+use d;
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+
+--connection server_3
+--echo #Server 3
+--echo #
+stop slave "m2_s3";
+SET default_master_connection = "m2_s3";
+--source include/wait_for_slave_to_stop.inc
+
+--connection server_2
+--echo #Server 2
+--echo #
+create table t1(a int);
+--save_master_pos
+
+--connection server_1
+--echo #Server 1
+--echo #
+--sync_with_master 0,'m2_s1'
+--sync_with_master 0,'m3_s1'
+show tables;
+#Send event into server 3;
+create table t2(a int);
+--save_master_pos
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+
+--connection server_3
+--echo #Server 3
+--echo #
+--sleep 2
+#We cant so sync becuase we stopped the slave
+--sync_with_master 0,'m1_s3'
+show tables;
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+
+
+--connection server_3
+--echo #Server 3
+--echo #
+start slave "m2_s3";
+SET default_master_connection = "m2_s3";
+--source include/wait_for_slave_to_start.inc
+--sleep 4
+show tables;
+select @@gtid_binlog_state;
+select @@gtid_current_pos;
+select @@gtid_slave_pos;
+
+# Cleanup
+--connection server_2
+--echo #Server 2
+--echo #
+drop database d;
