Bug #82525 mysql replicate from binlog one event to relay log produce Duplicate same event
Submitted: 10 Aug 2016 8:50 Modified: 23 Aug 2016 3:31
Reporter: Tiger Woo Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S1 (Critical)
Version:mysql-community-server-5.7.13 OS:Red Hat (redhat6.4_64bit_en_static_basic)
Assigned to: CPU Architecture:Any
Tags: binlog to relaylog, HA_ERR_FOUND_DUPP_KEY

[10 Aug 2016 8:50] Tiger Woo
Description:
Use mysql-community-server-5.7.13-1.el6.x86_64.rpm to install master and slave architecture databases. and write on master, slave only for read. use mysql own replication tech to realize data replicate from master to slave.
Repeatedly occurred one binlog event through slave database relay log can  produce two same event and cause HA_ERR_FOUND_DUPP_KEY error. and this caused data replication action stopped.

How to repeat:
my.cnf:
binlog_format=row
log_bin = /data/mysql/mysql{8}/{5}/perf001/blog/master-bin_{6}
log_bin_index = /data/mysql/mysql{8}/{5}/perf001/blog/master-bin_{6}.index
relay_log = /data/mysql/mysql{8}/{5}/perf001/rlog/relay-log_{6}
relay_log_index = /data/mysql/mysql{8}/{5}/perf001/rlog/relay-log_{6}.index
sync_binlog = 1
log-error = /data/mysql/mysql{8}/{5}/logs/mysql_{5}.err
gtid_mode = on
enforce_gtid_consistency = 1
log_slave_updates = 1
transaction_isolation = READ-COMMITTED
default_password_lifetime = 0

master_info_repository = TABLE
relay_log_info_repository = TABLE
relay_log_space_limit= 4294967295000

slave_parallel_type=LOGICAL_CLOCK
slave_parallel_workers=500
slave_preserve_commit_order=1
[10 Aug 2016 9:23] Tiger Woo
Confirm that binlog on master database only have one insert event for primary key 54784818
[23 Aug 2016 3:31] Tiger Woo
This not a bug. but according analysize this event and found that if use XA connection to operate data. under master/slave architecture database for mysql 5.7.1X. slave db which use binlog to replicate data from master to slave by parallel work threads will continue to consume memory and not release these memory and till exhaust all free memory and cause mysqld process killed by mysql safe process and restarted mysqld process by mysql safe process auto. due to this reason, cause dupliated record event happened.