| 1 |
RESET MASTER; |
| 2 |
CREATE TABLE t1 ( |
| 3 |
c1 INT NOT NULL PRIMARY KEY |
| 4 |
); |
| 5 |
# Generate binlog.000002 |
| 6 |
FLUSH LOGS; |
| 7 |
INSERT INTO t1 VALUES (1); |
| 8 |
# Generate binlog.000003 |
| 9 |
FLUSH LOGS; |
| 10 |
INSERT INTO t1 VALUES (2); |
| 11 |
# Generate binlog.000004 |
| 12 |
FLUSH LOGS; |
| 13 |
INSERT INTO t1 VALUES (3); |
| 14 |
# Move binlog.000002 to binlog.000002.bkp and |
| 15 |
# binlog.000003 to binlog.000003.bkp |
| 16 |
# |
| 17 |
# Only binlog.000001 and binlog.000004 remain, others are moved |
| 18 |
# , restart the server with enabled binlog-gtid-simple-recovery |
| 19 |
# and gtid_mode on. If the server scans more than one binary log in |
| 20 |
# every iteration, it will cause read error on the 2nd and 3rd files. |
| 21 |
# |
| 22 |
# restart:--gtid-mode=on --enforce-gtid-consistency --log-replica-updates --binlog-gtid-simple-recovery=ON |
| 23 |
# |
| 24 |
# Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty |
| 25 |
# after server restarts. |
| 26 |
# |
| 27 |
include/assert.inc [GLOBAL.GTID_EXECUTED must be empty.] |
| 28 |
include/assert.inc [GLOBAL.GTID_PURGED must be empty.] |
| 29 |
# |
| 30 |
# Write one gtid event into binlog.000004 |
| 31 |
# |
| 32 |
DROP TABLE t1; |
| 33 |
# Move binlog.000004 to binlog.000004.bkp |
| 34 |
# |
| 35 |
# Only binlog.000001 and binlog.000005 remain, others are moved |
| 36 |
# , restart the server with enabled binlog-gtid-simple-recovery |
| 37 |
# and gtid_mode on again. If the server scans more than one binary |
| 38 |
# log in every iteration, it will cause read error on the 2nd and |
| 39 |
# 4th files. |
| 40 |
# |
| 41 |
# restart:--gtid-mode=on --enforce-gtid-consistency --log-replica-updates --binlog-gtid-simple-recovery=ON |
| 42 |
# |
| 43 |
# Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 |
| 44 |
# and GLOBAL.GTID_PURGED is empty after server restarts again. |
| 45 |
# |
| 46 |
include/assert.inc [committed gtid MASTER_UUID:1] |
| 47 |
include/assert.inc [GLOBAL.GTID_PURGED is empty] |
| 48 |
# |
| 49 |
# Move binary logs back. |
| 50 |
# |
| 51 |
# |
| 52 |
# PURGE BINARY LOGS TO binlog.000006 |
| 53 |
# |
| 54 |
PURGE BINARY LOGS TO 'binlog.000006'; |
| 55 |
include/assert.inc [purged gtids MASTER_UUID:1] |