MySQL crash at case of using "monitoring_bg_kind>=1"

Bug #721206 reported by Hiroshi Sumi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Spider for MySQL
Fix Released
Medium
Kentoku SHIBA

Bug Description

MySQL crashes when execute any SQL After executing "CREATE TABLE" statement using "monitoring_bg_kind>=1".

monitoring_bg_kindに1以上を設定したCREATE TABLE文を発行後に、
SQLを実行しようとするとMySQLがクラッシュしてしまいます。

MySQL version: 5.5.8
Spider version: Spider 2.24 for 5.5.8
Using mysql-5.5.8-spider-2.24-vp-0.13-hs-1.0-linux-x86_64-glibc23.tgz

Spider table:
node: n1(sid = 101)

CREATE TABLE salaries (
  emp_no int(11) NOT NULL,
  salary int(11) NOT NULL,
  from_date date NOT NULL,
  to_date date NOT NULL,
  PRIMARY KEY (emp_no,from_date),
  KEY emp_no (emp_no)
) ENGINE SPIDER PARTITION BY KEY(emp_no) PARTITIONS 2
(
  PARTITION p1 COMMENT 'table "salaries", server "n5 n6", mbk "1", mkd "2", msi "102", link_status "1 1"',
  PARTITION p2 COMMENT 'table "salaries", server "n7 n8", mbk "1", mkd "2", msi "102", link_status "1 1"'
);

Remote InnoDB partition tables:
node:n5(sid=105),n6(sid=106),n7(sid=107),n8(sid=108)

CREATE TABLE salaries (
  emp_no int(11) NOT NULL,
  salary int(11) NOT NULL,
  from_date date NOT NULL,
  to_date date NOT NULL,
  PRIMARY KEY (emp_no,from_date),
  KEY emp_no (emp_no)
) ENGINE=InnoDB;

Monitoring Node: n2(sid=102),n3(sid=103),n4(sid=104)

servers:
+-------------+-----------+----+----------+----------+------+--------+---------+-------+
| Server_name | Host | Db | Username | Password | Port | Socket | Wrapper | Owner |
+-------------+-----------+----+----------+----------+------+--------+---------+-------+
| n1 | 127.0.0.1 | | msandbox | msandbox | 8359 | | mysql | |
| n2 | 127.0.0.1 | | msandbox | msandbox | 8360 | | mysql | |
| n3 | 127.0.0.1 | | msandbox | msandbox | 8361 | | mysql | |
| n4 | 127.0.0.1 | | msandbox | msandbox | 8362 | | mysql | |
| n5 | 127.0.0.1 | | msandbox | msandbox | 8363 | | mysql | |
| n6 | 127.0.0.1 | | msandbox | msandbox | 8364 | | mysql | |
| n7 | 127.0.0.1 | | msandbox | msandbox | 8365 | | mysql | |
| n8 | 127.0.0.1 | | msandbox | msandbox | 8366 | | mysql | |
+-------------+-----------+----+----------+----------+------+--------+---------+-------+

spider_link_mon_servers:
+---------+---------------+---------+-----+--------+
| db_name | table_name | link_id | sid | server |
+---------+---------------+---------+-----+--------+
| test | salaries#P#p1 | 0 | 102 | n2 |
| test | salaries#P#p1 | 0 | 103 | n3 |
| test | salaries#P#p1 | 0 | 104 | n4 |
| test | salaries#P#p2 | 0 | 102 | n2 |
| test | salaries#P#p2 | 0 | 103 | n3 |
| test | salaries#P#p2 | 0 | 104 | n4 |
| test | salaries#P#p1 | 1 | 102 | n2 |
| test | salaries#P#p1 | 1 | 103 | n3 |
| test | salaries#P#p1 | 1 | 104 | n4 |
| test | salaries#P#p2 | 1 | 102 | n2 |
| test | salaries#P#p2 | 1 | 103 | n3 |
| test | salaries#P#p2 | 1 | 104 | n4 |
+---------+---------------+---------+-----+--------+

After create Spider Table,
I try to execute SELECT statement and MySQL crashes:

上記のスパイダーテーブルを作成後にSELECT文を実行したのですが、MySQLがクラッシュしてしましました。

executed statement :

SELECT count(*) From salaries;

I get the following backtrace:

thd: 0xea902c0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x4a6b80b0 thread_stack 0x40000
/usr/local/mysql-5.5.8/bin/mysqld(my_print_stacktrace+0x33)[0x8dea53]
/usr/local/mysql-5.5.8/bin/mysqld(handle_segfault+0x35a)[0x4f776a]
/lib64/libpthread.so.0[0x3add20e7c0]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_Z31spider_set_connect_info_defaultP15st_spider_shareP17partition_elementS2_P5TABLE+0x100)[0x2aaaac23d6d0]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_Z25spider_get_ping_table_tgtP3THDPcjijP6StringbPi+0x2a3)[0x2aaaac250443]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_Z30spider_get_ping_table_mon_listP21st_spider_transactionP3THDP6StringjijbPi+0x240)[0x2aaaac250970]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_Z25spider_create_mon_threadsP21st_spider_transactionP15st_spider_share+0x1af)[0x2aaaac23603f]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_Z16spider_get_sharePKcP5TABLEP3THDP9ha_spiderPi+0x1ae8)[0x2aaaac24b488]
/usr/local/mysql-5.5.8/lib/plugin/ha_spider.so(_ZN9ha_spider4openEPKcij+0x4d)[0x2aaaac25932d]
/usr/local/mysql-5.5.8/bin/mysqld(_ZN7handler7ha_openEP5TABLEPKcii+0x3f)[0x665b4f]
/usr/local/mysql-5.5.8/bin/mysqld(_ZN12ha_partition4openEPKcij+0x19d)[0x8c4aad]
/usr/local/mysql-5.5.8/bin/mysqld(_ZN7handler7ha_openEP5TABLEPKcii+0x3f)[0x665b4f]
/usr/local/mysql-5.5.8/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x544)[0x5d99b4]
/usr/local/mysql-5.5.8/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP18Open_table_context+0x803)[0x535073]
/usr/local/mysql-5.5.8/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x780)[0x536b20]
/usr/local/mysql-5.5.8/bin/mysqld(_Z20open_and_lock_tablesP3THDP10TABLE_LISTbjP19Prelocking_strategy+0x4e)[0x536eee]
/usr/local/mysql-5.5.8/bin/mysqld[0x56635c]
/usr/local/mysql-5.5.8/bin/mysqld(_Z21mysql_execute_commandP3THD+0x35d1)[0x569ed1]
/usr/local/mysql-5.5.8/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x10a)[0x56c80a]
/usr/local/mysql-5.5.8/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1103)[0x56d973]
/usr/local/mysql-5.5.8/bin/mysqld(_Z10do_commandP3THD+0xc2)[0x56dcb2]
/usr/local/mysql-5.5.8/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x126)[0x5faf36]
/usr/local/mysql-5.5.8/bin/mysqld(handle_one_connection+0x53)[0x5fb023]
/lib64/libpthread.so.0[0x3add2064a7]
/lib64/libc.so.6(clone+0x6d)[0x3adcad3c2d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xeb192c0 = select count(*) from salaries
thd->thread_id=2
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

using "monitoring_bg_kind=2",this case occurred.

monitoring_bg_kindに"2"を設定した場合にも、この事象は発生しました。

using "monitoring_bg_kind=0",this case don't occurred.
and also In Spider 2.23 for 5.1.44 , this case don't occurred.

monitoring_bg_kindに"0"を設定した場合、この事象は発生しませんでした。
また、Spider2.23で同じことをした場合も、この事象は確認できませんでした

Revision history for this message
Kentoku SHIBA (kentokushiba) wrote :

バグレポートありがとうございます。
暫定対処版をアタッチさせていただきます。

Changed in spiderformysql:
assignee: nobody → Kentoku SHIBA (kentokushiba)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Kentoku SHIBA (kentokushiba) wrote :

バージョン2.25でリリースしました。

Changed in spiderformysql:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.