You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize Rows_query_log_event logging to save disk space
Summary:
A separate event for trx metadata was causing an unreasonable increase in binlog
size. Also, now we're not writing rows query event if there are no comments in
the query and `log_only_query_comments` is enabled
Reviewed By: anirbanr-fb
Differential Revision: D7002217
fbshipit-source-id: 1c3ab92
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
4
5
include/assert.inc [Logged query must match the one issued.]
Copy file name to clipboardexpand all lines: mysql-test/suite/rpl/r/binlog_trx_meta_data.result
+8-6
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,17 @@ Warnings:
3
3
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4
4
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
5
5
[connection master]
6
-
set @save.binlog_trx_meta_data= @@global.binlog_trx_meta_data;
7
6
set @@global.binlog_trx_meta_data= true;
8
-
set @save.binlog_trx_meta_data= @@global.binlog_trx_meta_data;
9
7
set @@global.binlog_trx_meta_data= true;
8
+
flush logs;
9
+
purge binary logs to 'master-bin.000002';
10
+
flush logs;
11
+
purge binary logs to 'slave-bin.000002';
10
12
meta count(*)
11
-
# /*::TRX_META_DATA::{"timestamps":[ts]}*/ 301
13
+
# /*::TRX_META_DATA::{"ts":[ts]}*/ 31
12
14
meta count(*)
13
-
# /*::TRX_META_DATA::{"timestamps":[ts,ts]}*/ 301
15
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ 31
14
16
drop table t1;
15
-
set @@global.binlog_trx_meta_data= @save.binlog_trx_meta_data;
16
-
set @@global.binlog_trx_meta_data= @save.binlog_trx_meta_data;
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4
+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
5
+
[connection master]
6
+
set @@global.binlog_trx_meta_data= true;
7
+
set @@global.binlog_trx_meta_data= true;
8
+
set @@session.binlog_rows_query_log_events= OFF;
9
+
set @@global.binlog_rows_query_log_events= OFF;
10
+
include/stop_slave.inc
11
+
include/start_slave.inc
12
+
flush logs;
13
+
purge binary logs to 'master-bin.000002';
14
+
flush logs;
15
+
purge binary logs to 'slave-bin.000002';
16
+
meta count(*)
17
+
# /*::TRX_META_DATA::{"ts":[ts]}*/ 31
18
+
meta count(*)
19
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ 31
20
+
drop table t1;
21
+
set @@session.binlog_rows_query_log_events= ON;
22
+
set @@global.log_only_query_comments= OFF;
23
+
set @@global.binlog_rows_query_log_events= ON;
24
+
set @@global.log_only_query_comments= OFF;
25
+
include/stop_slave.inc
26
+
include/start_slave.inc
27
+
flush logs;
28
+
purge binary logs to 'master-bin.000003';
29
+
flush logs;
30
+
purge binary logs to 'slave-bin.000003';
31
+
meta count(*)
32
+
# /*::TRX_META_DATA::{"ts":[ts]}*/ 1
33
+
# /*::TRX_META_DATA::{"ts":[ts]}*//*delete*/delete from t1 10
34
+
# /*::TRX_META_DATA::{"ts":[ts]}*//*insert*/insert into t1 values() 10
35
+
# /*::TRX_META_DATA::{"ts":[ts]}*//*update*/update t1 set a= a + 1 10
36
+
meta count(*)
37
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ 1
38
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*//*delete*/delete from t1 10
39
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*//*insert*/insert into t1 values() 10
40
+
# /*::TRX_META_DATA::{"ts":[ts,ts]}*//*update*/update t1 set a= a + 1 10
0 commit comments