Bug #82584 task_write: Assertion `con->fd >= 0' failed with group replication
Submitted: 15 Aug 2016 12:40 Modified: 12 Dec 2016 10:35
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S1 (Critical)
Version:5.7.14 OS:CentOS (7)
Assigned to: CPU Architecture:Any

[15 Aug 2016 12:40] Shahriyar Rzayev
Description:
Simple case using -> http://lefred.be/content/vagrant-environment-to-test-mysql-group-replication-0-8/

On node1:

1. CREATE TABLE `sbtest2` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   `k` int(10) unsigned NOT NULL DEFAULT '0',   `c` char(120) NOT NULL DEFAULT '',   `pad` char(60) NOT NULL DEFAULT '',   PRIMARY KEY (`id`),   KEY `k_1` (`k`) ) data directory = '/tmp/sbtest1.ibd';

Tablespace path will be ->  /tmp/sbtest1.ibd/dbtest/sbtest2.ibd

2. Try to insert data from sbtest1 into sbtest2:
mysql1 mysql> insert into sbtest2 select * from sbtest1;
ERROR 2013 (HY000): Lost connection to MySQL server during query

From error log:

2016-08-15T12:03:24.392548Z 0 [Note] Plugin group_replication reported: 'getstart group_id 3018aed1'
2016-08-15T12:03:27.509537Z 0 [Note] Plugin group_replication reported: 'state 4185 action xa_terminate'
2016-08-15T12:03:27.514367Z 0 [Note] Plugin group_replication reported: '1471262607.514349 /export/home/pb2/build/sb_0-19878585-1469705299.56/rpm/BUILD/mysql-5.7.14-labs-gr080/mys
ql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:2179 new state x_start'
2016-08-15T12:03:27.514383Z 0 [Note] Plugin group_replication reported: 'state 4115 action xa_exit'
2016-08-15T12:03:27.514433Z 0 [Note] Plugin group_replication reported: 'Exiting xcom thread'
2016-08-15T12:03:27.514439Z 0 [Note] Plugin group_replication reported: '1471262607.514436 /export/home/pb2/build/sb_0-19878585-1469705299.56/rpm/BUILD/mysql-5.7.14-labs-gr080/mys
ql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:2180 new state x_start'
mysqld: /export/home/pb2/build/sb_0-19878585-1469705299.56/rpm/BUILD/mysql-5.7.14-labs-gr080/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/x
com/task.c:1094: task_write: Assertion `con->fd >= 0' failed.
12:03:27 UTC - mysqld got signal 6 ;
/usr/lib64/mysql/plugin/group_replication.so(task_write+0x244)[0x7fb162695614]
/usr/lib64/mysql/plugin/group_replication.so(sender_task+0xb31)[0x7fb162655041]
/usr/lib64/mysql/plugin/group_replication.so(task_loop+0x50)[0x7fb1626957c0]
/usr/lib64/mysql/plugin/group_replication.so(xcom_taskmain2+0xc9)[0x7fb1626435f9]
/usr/lib64/mysql/plugin/group_replication.so(_ZN19Gcs_xcom_proxy_impl9xcom_initEi+0x20)[0x7fb162623470]
/usr/lib64/mysql/plugin/group_replication.so(+0x12404d)[0x7fb16268604d]

How to repeat:
sbtest1 table structure:

CREATE TABLE `sbtest1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `c` char(120) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=256862 DEFAULT CHARSET=latin1 MAX_ROWS=1000000

create tablespace t1 add datafile 't1.ibd' engine=innodb;
alter table sbtest1 tablespace=t1;

Also see description.
[16 Aug 2016 9:45] MySQL Verification Team
Hello Shahriyar,

Thank you for the report.

Thanks,
Umesh
[16 Aug 2016 9:46] MySQL Verification Team
-- 5.7.14

(gdb) bt
#0  0x00007f7f3391d771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000007a3db5 in handle_fatal_signal (sig=6) at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/sql/signal_handler.cc:220
#2  <signal handler called>
#3  0x00007f7f323175d7 in raise () from /lib64/libc.so.6
#4  0x00007f7f32318cc8 in abort () from /lib64/libc.so.6
#5  0x00007f7f32310546 in __assert_fail_base () from /lib64/libc.so.6
#6  0x00007f7f323105f2 in __assert_fail () from /lib64/libc.so.6
#7  0x00007f7ee6697364 in task_write (con=con@entry=0x7f7ec01fb618, _buf=0x7f7ddfc36010, n=407442556, ret=ret@entry=0x7f7ef97fa570)
    at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.c:1094
#8  0x00007f7ee66584f1 in _send_msg (ret=0x7f7ef97fa560, to=<optimized out>, p=<optimized out>, s=0x7f7ec01fb600)
    at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:232
#9  sender_task (arg=...) at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_transport.c:1490
#10 0x00007f7ee6697510 in task_loop () at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/task.c:1220
#11 0x00007f7ee6647702 in xcom_taskmain2 (listen_port=10301)
    at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_base.c:1108
#12 0x00007f7ee6627ea0 in Gcs_xcom_proxy_impl::xcom_init (this=<optimized out>, xcom_listen_port=10301)
    at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_utils.cc:241
#13 0x00007f7ee66883cd in xcom_taskmain_startup (ptr=0x7f7ed809a320)
    at /export/umesh/server/source/bugs/mysql-5.7.14-labs-gr080/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xcom_control_interface.cc:101
#14 0x00007f7f33918df5 in start_thread () from /lib64/libpthread.so.0
#15 0x00007f7f323d860d in clone () from /lib64/libc.so.6
[12 Dec 2016 10:35] David Moss
Posted by developer:
 
Thanks for your feedback, this has been fixed in 5.7.17.