| 1 |
RESET MASTER; |
| 2 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (); |
| 3 |
and the command execution is effective thence rotates binlog as usual |
| 4 |
show binary logs; |
| 5 |
Log_name File_size |
| 6 |
master-bin.000001 # |
| 7 |
master-bin.000002 # |
| 8 |
Non-existed domain is warned, the command completes without rotation |
| 9 |
but with a warning |
| 10 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99); |
| 11 |
Warnings: |
| 12 |
Warning 1076 The gtid domain being deleted ('99') is not in the current binlog state |
| 13 |
show binary logs; |
| 14 |
Log_name File_size |
| 15 |
master-bin.000001 # |
| 16 |
master-bin.000002 # |
| 17 |
SET @@SESSION.gtid_domain_id=1; |
| 18 |
SET @@SESSION.server_id=1; |
| 19 |
CREATE TABLE t (a int); |
| 20 |
SELECT @@GLOBAL.gtid_binlog_state, @@GLOBAL.gtid_binlog_pos; |
| 21 |
@@GLOBAL.gtid_binlog_state @@GLOBAL.gtid_binlog_pos |
| 22 |
1-1-1 1-1-1 |
| 23 |
include/show_binlog_events.inc |
| 24 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 25 |
master-bin.000001 # Rotate # # master-bin.000002;pos=POS |
| 26 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1); |
| 27 |
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files. |
| 28 |
FLUSH BINARY LOGS; |
| 29 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1); |
| 30 |
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files. |
| 31 |
PURGE BINARY LOGS TO 'master-bin.000003';; |
| 32 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1); |
| 33 |
Gtid_list of the current binlog does not contain '1': |
| 34 |
show binlog events in 'master-bin.000004' limit 1,1; |
| 35 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 36 |
master-bin.000004 # Gtid_list 1 # [] |
| 37 |
But the previous log's Gtid_list may have it which explains a warning from the following command |
| 38 |
show binlog events in 'master-bin.000003' limit 1,1; |
| 39 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 40 |
master-bin.000003 # Gtid_list 1 # [1-1-1] |
| 41 |
Already deleted domain in Gtid_list of the earliest log is benign |
| 42 |
but may cause a warning |
| 43 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1); |
| 44 |
Warnings: |
| 45 |
Warning 1076 The current gtid binlog state is incompatible with a former one missing gtids from the '1-1' domain-server pair which is referred to in the gtid list describing an earlier state. Ignore if the domain ('1') was already explicitly deleted. |
| 46 |
Warning 1076 The gtid domain being deleted ('1') is not in the current binlog state |
| 47 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0); |
| 48 |
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files. |
| 49 |
MDEV-31140: Missing error from DELETE_DOMAIN_ID when gtid_binlog_state partially matches GTID_LIST. |
| 50 |
FLUSH BINARY LOGS; |
| 51 |
PURGE BINARY LOGS TO 'master-bin.000005'; |
| 52 |
show binary logs; |
| 53 |
Log_name File_size |
| 54 |
master-bin.000005 # |
| 55 |
SET @@SESSION.gtid_domain_id=8; |
| 56 |
SET @@SESSION.server_id=10*8 + 1; |
| 57 |
INSERT INTO t SELECT 1+MAX(a) FROM t; |
| 58 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0); |
| 59 |
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('8') being deleted. Make sure to first purge those files. |
| 60 |
FLUSH BINARY LOGS; |
| 61 |
PURGE BINARY LOGS TO 'master-bin.000006'; |
| 62 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0); |
| 63 |
Warnings: |
| 64 |
Warning 1076 The gtid domain being deleted ('0') is not in the current binlog state |
| 65 |
Gtid_list of the current binlog does not contain 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0: |
| 66 |
show binlog events in 'master-bin.000007' limit 1,1; |
| 67 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 68 |
master-bin.000007 # Gtid_list 1 # [] |
| 69 |
SET @@SESSION.gtid_domain_id=1;; |
| 70 |
SET @@SESSION.server_id=1; |
| 71 |
SET @@SESSION.gtid_seq_no=1; |
| 72 |
INSERT INTO t SET a=1; |
| 73 |
SET @@SESSION.server_id=2; |
| 74 |
SET @@SESSION.gtid_seq_no=2; |
| 75 |
INSERT INTO t SET a=2; |
| 76 |
SET @@SESSION.gtid_domain_id=11; |
| 77 |
SET @@SESSION.server_id=11; |
| 78 |
SET @@SESSION.gtid_seq_no=11; |
| 79 |
INSERT INTO t SET a=11; |
| 80 |
SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state; |
| 81 |
FLUSH BINARY LOGS; |
| 82 |
SET @@SESSION.gtid_domain_id=11; |
| 83 |
SET @@SESSION.server_id=11; |
| 84 |
SET @@SESSION.gtid_seq_no=1; |
| 85 |
INSERT INTO t SET a=1; |
| 86 |
SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state"; |
| 87 |
as original state out of order for 11 domain state |
| 88 |
1-1-1,1-2-2,11-11-11 1-1-1,1-2-2,11-11-1 |
| 89 |
PURGE BINARY LOGS TO 'master-bin.000008'; |
| 90 |
the following command succeeds with warnings |
| 91 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1); |
| 92 |
Warnings: |
| 93 |
Warning 1076 The current gtid binlog state is incompatible with a former one having a gtid '11-11-1' which is less than the '11-11-11' of the gtid list describing an earlier state. The state may have been affected by manually injecting a lower sequence number gtid or via replication. |
| 94 |
RESET MASTER; |
| 95 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967296); |
| 96 |
ERROR HY000: The value of gtid domain being deleted ('4294967296') exceeds its maximum size of 32 bit unsigned integer |
| 97 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967295); |
| 98 |
Warnings: |
| 99 |
Warning 1076 The gtid domain being deleted ('4294967295') is not in the current binlog state |
| 100 |
RESET MASTER; |
| 101 |
SET @@GLOBAL.gtid_domain_id=0; |
| 102 |
SET @@SESSION.gtid_domain_id=0; |
| 103 |
CREATE USER u; |
| 104 |
FLUSH BINARY LOGS; |
| 105 |
PURGE BINARY LOGS TO 'master-bin.000002'; |
| 106 |
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (0), BINARY LOGS DELETE_DOMAIN_ID = (0); |
| 107 |
DROP USER u; |
| 108 |
DROP TABLE t; |
| 109 |
RESET MASTER; |