| 1 |
select @@global.max_binlog_total_size; |
| 2 |
@@global.max_binlog_total_size |
| 3 |
1500 |
| 4 |
select @@global.max_binlog_size; |
| 5 |
@@global.max_binlog_size |
| 6 |
4096 |
| 7 |
# |
| 8 |
# MDEV-31404 Implement binlog_space_limit |
| 9 |
# |
| 10 |
FLUSH LOGS; |
| 11 |
FLUSH LOGS; |
| 12 |
FLUSH LOGS; |
| 13 |
show binary logs; |
| 14 |
Log_name File_size |
| 15 |
binary.000001 # |
| 16 |
binary.000002 # |
| 17 |
binary.000003 # |
| 18 |
binary.000004 # |
| 19 |
show status like "binlog_disk_use"; |
| 20 |
Variable_name Value |
| 21 |
Binlog_disk_use 1552 |
| 22 |
set @@global.slave_connections_needed_for_purge= 0; |
| 23 |
# binary.000001 should be deleted now |
| 24 |
show binary logs; |
| 25 |
Log_name File_size |
| 26 |
binary.000002 # |
| 27 |
binary.000003 # |
| 28 |
binary.000004 # |
| 29 |
show status like "binlog_disk_use"; |
| 30 |
Variable_name Value |
| 31 |
Binlog_disk_use 1183 |
| 32 |
CREATE TABLE `t1` ( |
| 33 |
`v1` int(11) DEFAULT NULL, |
| 34 |
`v2` varchar(8000) DEFAULT NULL, |
| 35 |
KEY `v1` (`v1`) |
| 36 |
) engine=myisam; |
| 37 |
INSERT INTO t1 VALUES (0,repeat("a",3000)); |
| 38 |
show status like "binlog_disk_use"; |
| 39 |
Variable_name Value |
| 40 |
Binlog_disk_use 3863 |
| 41 |
# First binary should be binary.000004 |
| 42 |
show binary logs; |
| 43 |
Log_name File_size |
| 44 |
binary.000004 # |
| 45 |
INSERT INTO t1 VALUES (2,repeat("b",10)); |
| 46 |
# First binary should be binary.000004 |
| 47 |
show binary logs; |
| 48 |
Log_name File_size |
| 49 |
binary.000004 # |
| 50 |
binary.000005 # |
| 51 |
FLUSH LOGS; |
| 52 |
# First binary should be binary.000005 |
| 53 |
show binary logs; |
| 54 |
Log_name File_size |
| 55 |
binary.000005 # |
| 56 |
binary.000006 # |
| 57 |
FLUSH LOGS; |
| 58 |
FLUSH LOGS; |
| 59 |
FLUSH LOGS; |
| 60 |
FLUSH LOGS; |
| 61 |
show binary logs; |
| 62 |
Log_name File_size |
| 63 |
binary.000008 # |
| 64 |
binary.000009 # |
| 65 |
binary.000010 # |
| 66 |
show status like "binlog_disk_use"; |
| 67 |
Variable_name Value |
| 68 |
Binlog_disk_use 1225 |
| 69 |
PURGE BINARY LOGS TO 'binary.000009'; |
| 70 |
# First binary should be binary.000009 |
| 71 |
show binary logs; |
| 72 |
Log_name File_size |
| 73 |
binary.000009 # |
| 74 |
binary.000010 # |
| 75 |
INSERT INTO t1 VALUES (3,repeat("c",4000)); |
| 76 |
# First binary should be binary.000010 |
| 77 |
show binary logs; |
| 78 |
Log_name File_size |
| 79 |
binary.000010 # |
| 80 |
binary.000011 # |
| 81 |
INSERT INTO t1 VALUES (4,repeat("d",3000)); |
| 82 |
# First binary should be binary.000011 |
| 83 |
show binary logs; |
| 84 |
Log_name File_size |
| 85 |
binary.000011 # |
| 86 |
RESET MASTER; |
| 87 |
show binary logs; |
| 88 |
Log_name File_size |
| 89 |
binary.000001 # |
| 90 |
show status like "binlog_disk_use"; |
| 91 |
Variable_name Value |
| 92 |
Binlog_disk_use 325 |
| 93 |
INSERT INTO t1 VALUES (5,"e"); |
| 94 |
FLUSH LOGS; |
| 95 |
INSERT INTO t1 VALUES (6,repeat("f",3000)); |
| 96 |
show binary logs; |
| 97 |
Log_name File_size |
| 98 |
binary.000002 # |
| 99 |
show status like "binlog_disk_use"; |
| 100 |
Variable_name Value |
| 101 |
Binlog_disk_use 3647 |
| 102 |
INSERT INTO t1 VALUES (7,repeat("g",3000)); |
| 103 |
# binary.000001 should be deleted now |
| 104 |
show binary logs; |
| 105 |
Log_name File_size |
| 106 |
binary.000002 # |
| 107 |
binary.000003 # |
| 108 |
show status like "binlog_disk_use"; |
| 109 |
Variable_name Value |
| 110 |
Binlog_disk_use 7338 |
| 111 |
FLUSH LOGS; |
| 112 |
FLUSH LOGS; |
| 113 |
# binary.000002 should be deleted now |
| 114 |
show binary logs; |
| 115 |
Log_name File_size |
| 116 |
binary.000003 423 |
| 117 |
binary.000004 423 |
| 118 |
binary.000005 379 |
| 119 |
show status like "binlog_disk_use"; |
| 120 |
Variable_name Value |
| 121 |
Binlog_disk_use 1225 |
| 122 |
DROP TABLE IF EXISTS t1; |
| 123 |
set @@global.slave_connections_needed_for_purge= default; |