pacemaker-replication-agents icon indicating copy to clipboard operation
pacemaker-replication-agents copied to clipboard

mysqlbinlog is slow for agent purposes

Open dotmanila opened this issue 8 years ago • 1 comments

For example:

[root@mysql tmp]# time mysqlbinlog -vvv --base64-output=decode-rows mysqld-relay-bin.001185 | grep 'Xid =' -A2 | grep -v '\-\-' | tail -n 186 | egrep 'Xid|\# at [0-9]{2,10}' | tac | grep -A2 Xid |grep '# at ' | tail -n 1 | rev | cut -d' ' -f1 | rev
422883242

real	0m19.517s
user	0m23.235s
sys	0m5.289s

This can cause monitor call to timeout - we need something like MHA binlog parser but the agent is written in Shell, so we might need another solution - perhaps one in python.

dotmanila avatar Mar 09 '17 05:03 dotmanila

We encounter the same issue. Easiest solution is to write python/C "helper" to implement that slow loop, which calculates md5sum for each transaction. But even C implementation takes about 5 sec to scan 1G binlog

sorcky avatar Nov 15 '18 06:11 sorcky