Bug #76618 | SHOW BINLOG EVENTS completely locks down writes to binlog, hence transactions | ||
---|---|---|---|
Submitted: | 8 Apr 2015 11:23 | Modified: | 24 Aug 2015 15:06 |
Reporter: | Shlomi Noach (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Utilities: Binlog Events | Severity: | S3 (Non-critical) |
Version: | 5.6.15-log | OS: | Linux (CentOS release 6.5) |
Assigned to: | CPU Architecture: | Any | |
Tags: | binary logs, binlogs, lock |
[8 Apr 2015 11:23]
Shlomi Noach
[8 Apr 2015 11:24]
Shlomi Noach
I pasted the "show processlist" above in reverse order. Anyway the purpose was to show how lock was taken through many seconds.
[8 Apr 2015 11:52]
Shlomi Noach
Cross-referencing feature request for go-mysql driver: https://github.com/go-sql-driver/mysql/issues/328
[22 Apr 2015 11:45]
MySQL Verification Team
On 5.6.15, commits hang here: ntdll!ZwWaitForSingleObject+0xa ntdll!RtlpWaitOnCriticalSection+0xe8 ntdll!RtlEnterCriticalSection+0xd1 mysqld!MYSQL_BIN_LOG::change_stage+0xa8 [.\mysql-5.6.15\sql\binlog.cc @ 6568] mysqld!MYSQL_BIN_LOG::ordered_commit+0x6c [.\mysql-5.6.15\sql\binlog.cc @ 6780] mysqld!MYSQL_BIN_LOG::commit+0x333 [.\mysql-5.6.15\sql\binlog.cc @ 6288] mysqld!ha_commit_trans+0x1a5 [.\mysql-5.6.15\sql\handler.cc @ 1435] mysqld!trans_commit_stmt+0x35 [.\mysql-5.6.15\sql\transaction.cc @ 435] mysqld!mysql_execute_command+0x3c2d [.\mysql-5.6.15\sql\sql_parse.cc @ 4998] mysqld!mysql_parse+0x1ed [.\mysql-5.6.15\sql\sql_parse.cc @ 6240] mysqld!dispatch_command+0x70d [.\mysql-5.6.15\sql\sql_parse.cc @ 1337] mysqld!do_command+0x167 [.\mysql-5.6.15\sql\sql_parse.cc @ 1042] mysqld!do_handle_one_connection+0x134 [.\mysql-5.6.15\sql\sql_connect.cc @ 982] mysqld!handle_one_connection+0x3a [.\mysql-5.6.15\sql\sql_connect.cc @ 900] mysqld!pfs_spawn_thread+0x136 [.\mysql-5.6.15\storage\perfschema\pfs.cc @ 1861] mysqld!pthread_start+0x1e [.\mysql-5.6.15\mysys\my_winthread.c @ 63] While a low client using mysql_use_result is transfering data: | Time | State | Info +------+----------------+---------------------------------------- | 33 | query end | update ignore `blobtest_12` as `t1`,`bl | 0 | init | show processlist | 31 | Writing to net | show binlog events in "i7-bin.000003" +------+----------------+---------------------------------------- WS2_32!DPROVIDER::WSPSend+0x6c WS2_32!send+0xce mysqld!vio_write+0xc6 [.\mysql-5.6.15\vio\viosocket.c @ 192] mysqld!net_write_raw_loop+0x42 [.\mysql-5.6.15\sql\net_serv.cc @ 503] mysqld!net_write_packet+0x8b [.\mysql-5.6.15\sql\net_serv.cc @ 636] mysqld!net_write_buff+0x78 [.\mysql-5.6.15\sql\net_serv.cc @ 452] mysqld!my_net_write+0xe6 [.\mysql-5.6.15\sql\net_serv.cc @ 325] mysqld!Protocol::write+0x1f [.\mysql-5.6.15\sql\protocol.cc @ 822] mysqld!Log_event::net_send+0xd2 [.\mysql-5.6.15\sql\log_event.cc @ 918] mysqld!show_binlog_events+0x37e [.\mysql-5.6.15\sql\binlog.cc @ 2295] mysqld!mysql_show_binlog_events+0x71 [.\mysql-5.6.15\sql\binlog.cc @ 2375] mysqld!mysql_execute_command+0x8a9 [.\mysql-5.6.15\sql\sql_parse.cc @ 2757] mysqld!mysql_parse+0x1ed [.\mysql-5.6.15\sql\sql_parse.cc @ 6240] mysqld!dispatch_command+0x70d [.\mysql-5.6.15\sql\sql_parse.cc @ 1337] mysqld!do_command+0x167 [.\mysql-5.6.15\sql\sql_parse.cc @ 1042] mysqld!do_handle_one_connection+0x134 [.\mysql-5.6.15\sql\sql_connect.cc @ 982] mysqld!handle_one_connection+0x3a [.\mysql-5.6.15\sql\sql_connect.cc @ 900] mysqld!pfs_spawn_thread+0x136 [.\mysql-5.6.15\storage\perfschema\pfs.cc @ 1861] mysqld!pthread_start+0x1e [.\mysql-5.6.15\mysys\my_winthread.c @ 63] mysqld!_callthreadstartex+0x17 [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\thr mysqld!_threadstartex+0x7f [f:\dd\vctools\crt_bld\self_64_amd64\crt\src\threade kernel32!BaseThreadInitThunk+0xd
[22 Apr 2015 11:48]
MySQL Verification Team
same on 5.6.24
[22 Apr 2015 12:00]
MySQL Verification Team
same symptom on 5.7.8..
[24 Aug 2015 15:06]
David Moss
Thanks for your feedback. This has been fixed in upcoming versions and the following was added to the 5.6.27 and 5.7.9 changelogs: While a SHOW BINLOG EVENTS statement was executing, any parallel transaction was blocked. The fix ensures that the SHOW BINLOG EVENTS process now only acquires a lock for the duration of calculating the file's end position, therefore parallel transactions are not blocked for long durations.