By the way, thread 9 is the query that always hangs the server for the last few times Thread 9 (Thread 0x7f31cb99e700 (LWP 27968)): #0 0x00007f31cce007be in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x00007f31c9d207ec in toku_cond_timedwait (cond=, mutex=, wakeup_at=) at /home/jynus/mariadb-10.0.22/storage/tokudb/ft-index/portabi lity/toku_pthread.h:325 #2 wait (killed_callback=0x7f31c9c6fdd0 , killed_time_ms=, wait_time_ms=, this=0x7f31cb99b460) at /home/jynus/mariadb-10.0.2 2/storage/tokudb/ft-index/locktree/lock_request.cc:273 #3 toku_db_wait_range_lock (db=db@entry=0x7f2c59fdb0c0, txn=txn@entry=0x7f2f2d1b8e00, request=request@entry=0x7f31cb99b460) at /home/jynus/mariadb-10.0.22/storage/tokudb/ft-index/s rc/ydb_row_lock.cc:279 #4 0x00007f31c9d3cbd6 in toku_db_get_range_lock (db=db@entry=0x7f2c59fdb0c0, txn=txn@entry=0x7f2f2d1b8e00, left_key=left_key@entry=0x7f31cb99b890, right_key=right_key@entry=0x7f31c b99b890, lock_type=lock_type@entry=toku::lock_request::WRITE) at /home/jynus/mariadb-10.0.22/storage/tokudb/ft-index/src/ydb_row_lock.cc:239 #5 0x00007f31c9d3d113 in toku_db_get_point_write_lock (db=db@entry=0x7f2c59fdb0c0, txn=txn@entry=0x7f2f2d1b8e00, key=key@entry=0x7f31cb99b890) at /home/jynus/mariadb-10.0.22/storag e/tokudb/ft-index/src/ydb_row_lock.cc:293 #6 0x00007f31c9d3d752 in env_put_multiple_internal (flags_array=0x7f2c59943420, vals=0x7f2c59943010, keys=0x7f2c599427f0, db_array=0x7f2c59987158, num_dbs=2, src_val=0x7f31cb99b870 , src_key=0x7f31cb99b890, txn=0x7f2f2d1b8e00, src_db=0x7f2c59fdb0c0, env=0x7f2fa83c1980) at /home/jynus/mariadb-10.0.22/storage/tokudb/ft-index/src/ydb_write.cc:790 #7 env_put_multiple (env=0x7f2fa83c1980, src_db=0x7f2c59fdb0c0, txn=0x7f2f2d1b8e00, src_key=0x7f31cb99b890, src_val=0x7f31cb99b870, num_dbs=2, db_array=0x7f2c59987158, keys=0x7f2c5 99427f0, vals=0x7f2c59943010, flags_array=0x7f2c59943420) at /home/jynus/mariadb-10.0.22/storage/tokudb/ft-index/src/ydb_write.cc:1174 #8 0x00007f31c9c86bd8 in ha_tokudb::insert_rows_to_dictionaries_mult (this=this@entry=0x7f2c59942020, pk_key=pk_key@entry=0x7f31cb99b890, pk_val=pk_val@entry=0x7f31cb99b870, txn=tx n@entry=0x7f2f2d1b8e00, thd=thd@entry=0x7f2f4c014008) at /home/jynus/mariadb-10.0.22/storage/tokudb/ha_tokudb.cc:3852 #9 0x00007f31c9c95071 in ha_tokudb::write_row (this=0x7f2c59942020, record=0x7f2c59fea820 "@\321\a") at /home/jynus/mariadb-10.0.22/storage/tokudb/ha_tokudb.cc:4006 #10 0x0000000000747f7b in handler::ha_write_row (this=0x7f2c59942020, buf=0x7f2c59fea820 "@\321\a") at /home/jynus/mariadb-10.0.22/sql/handler.cc:6004 #11 0x00000000005b59bf in write_record (thd=thd@entry=0x7f2f4c014008, table=table@entry=0x7f2c5988b208, info=info@entry=0x7f31cb99bb80) at /home/jynus/mariadb-10.0.22/sql/sql_insert .cc:1847 #12 0x00000000005b8fcb in mysql_insert (thd=thd@entry=0x7f2f4c014008, table_list=0x7f2f4c0300e8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=true) at /home/jynus/mariadb-10.0.22/sql/sql_insert.cc:964 #13 0x00000000005d511c in mysql_execute_command (thd=thd@entry=0x7f2f4c014008) at /home/jynus/mariadb-10.0.22/sql/sql_parse.cc:3448 #14 0x00000000005d9a5a in mysql_parse (thd=0x7f2f4c014008, rawbuf=, length=106, parser_state=parser_state@entry=0x7f31cb99d3e0) at /home/jynus/mariadb-10.0.22/sql/sql _parse.cc:6546 #15 0x000000000081bc5d in Query_log_event::do_apply_event (this=0x7f2c75356ec8, rgi=0x7f2f32047b00, query_arg=0x7f2f2d25c213 "INSERT /* User::addGroup 127.0.0.1 */ IGNORE INTO `user _groups` (ug_user,ug_group) VALUES ('512320','bot')", q_len_arg=106) at /home/jynus/mariadb-10.0.22/sql/log_event.cc:4347 #16 0x000000000055aebd in apply_event (rgi=0x7f2f32047b00, this=0x7f2c75356ec8) at /home/jynus/mariadb-10.0.22/sql/log_event.h:1360 #17 apply_event_and_update_pos (ev=ev@entry=0x7f2c75356ec8, thd=thd@entry=0x7f2f4c014008, rgi=rgi@entry=0x7f2f32047b00, rpt=rpt@entry=0x7f2f4f0f2468) at /home/jynus/mariadb-10.0.22/ sql/slave.cc:3290 #18 0x00000000006e5da7 in rpt_handle_event (qev=qev@entry=0x7f2d8f16bc08, rpt=rpt@entry=0x7f2f4f0f2468) at /home/jynus/mariadb-10.0.22/sql/rpl_parallel.cc:49 #19 0x00000000006e6a74 in retry_event_group (rgi=rgi@entry=0x7f2f32047b00, rpt=rpt@entry=0x7f2f4f0f2468, orig_qev=orig_qev@entry=0x7f2f47ce4708) at /home/jynus/mariadb-10.0.22/sql/r pl_parallel.cc:592 #20 0x00000000006e8785 in handle_rpl_parallel_thread (arg=) at /home/jynus/mariadb-10.0.22/sql/rpl_parallel.cc:977 #21 0x00007f31ccdfc184 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #22 0x00007f31cbce037d in clone () from /lib/x86_64-linux-gnu/libc.so.6