|
[slave]
mysql>> Query OK, 2 rows affected (0.12 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> insert into t values(1);
mysql> insert into t values(4);
mysql> insert into t values(5);
mysql> show master status ;
+-------------------+----------+--------------+------------------+-------------------------------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+-------------------+----------+--------------+------------------+-------------------------------------------+
| mysql-info.000004 | 914 | | | 5882bfb0-c936-11e4-a843-000c292dc103:1-17 |
+-------------------+----------+--------------+------------------+-------------------------------------------+
1 row in set (0.00 sec)
mysql> show slave status \G
*************************** 1. row ***************************
...
Slave_IO_Running: Yes
lave_SQL_Running: No
Last_Errno: 1062
Last_Error: Could not execute Write_rows event on table db_test.t; Duplicate entry '1' for key 'PRIMARY',
Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-info.000004, end_log_pos 401
Retrieved_Gtid_Set: 5882bfb0-c936-11e4-a843-000c292dc103:1-15
Executed_Gtid_Set: 5882bfb0-c936-11e4-a843-000c292dc103:1-14,
f1e6584a-c935-11e4-a840-000c29348dbe:1
Auto_Position: 1
1 row in set (0.00 sec)
mysql> SET @@SESSION.GTID_NEXT= '5882bfb0-c936-11e4-a843-000c292dc103:15';
Query OK, 0 rows affected (0.00 sec)
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> SET SESSION GTID_NEXT = AUTOMATIC;
mysql> start slave;
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Last_Errno: 0
Retrieved_Gtid_Set: 5882bfb0-c936-11e4-a843-000c292dc103:1-17
Executed_Gtid_Set: 5882bfb0-c936-11e4-a843-000c292dc103:1-17,
f1e6584a-c935-11e4-a840-000c29348dbe:1
Auto_Position: 1
1 row in set (0.00 sec) |
|
|