From 640051e06aa585b056671738a6614cd314074ac6 Mon Sep 17 00:00:00 2001 From: vinchen Date: Sat, 8 Oct 2016 12:07:26 +0800 Subject: Binlog compressed Add some event types for the compressed event, there are: QUERY_COMPRESSED_EVENT, WRITE_ROWS_COMPRESSED_EVENT_V1, UPDATE_ROWS_COMPRESSED_EVENT_V1, DELETE_POWS_COMPRESSED_EVENT_V1, WRITE_ROWS_COMPRESSED_EVENT, UPDATE_ROWS_COMPRESSED_EVENT, DELETE_POWS_COMPRESSED_EVENT. These events inheritance the uncompressed editor events. One of their constructor functions and write function have been overridden for uncompressing and compressing. Anything but this is totally the same. On slave, The IO thread will uncompress and convert them When it receiving the events from the master. So the SQL and worker threads can be stay unchanged. Now we use zlib as compress algorithm. It maybe support other algorithm in the future. --- sql/sql_repl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_repl.cc') diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index bdf90f7caf6..c115ac5f0ec 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1629,7 +1629,7 @@ is_until_reached(binlog_send_info *info, ulong *ev_offset, break; case GTID_UNTIL_STOP_AFTER_TRANSACTION: if (event_type != XID_EVENT && - (event_type != QUERY_EVENT || + (event_type != QUERY_EVENT || /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ !Query_log_event::peek_is_commit_rollback (info->packet->ptr()+*ev_offset, info->packet->length()-*ev_offset, @@ -1863,7 +1863,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type, return NULL; case GTID_SKIP_TRANSACTION: if (event_type == XID_EVENT || - (event_type == QUERY_EVENT && + (event_type == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ Query_log_event::peek_is_commit_rollback(packet->ptr() + ev_offset, len - ev_offset, current_checksum_alg))) -- cgit v1.2.1