Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP

Loading…

slave crash on update with row based binary logging #18

Closed
yoshinorim opened this Issue · 3 comments

2 participants

@yoshinorim
Owner

How to repeat:

  1. Create regular master/slave instances.
  2. Run the following statements on master. Then slave crashed on update. create table x (id int primary key, value int, value2 int, index(value)) engine=rocksdb; insert into x values (1,1,1); insert into x values (2,1,1); insert into x values (3,1,1); insert into x values (4,1,1); insert into x values (5,1,1); update x set value2=100 where id=1;

On my environment, mysqld crashed at ha_rocksdb::position().
#0 ha_rocksdb::position (this=0x7f235d432910, record=0x7f235d503410 "\371\001")
at /data/users/yoshinori/mysql/5.6/storage/rocksdb/ha_rocksdb.cc:3152
#1 0x0000000000636b86 in handler::rnd_pos_by_record (this=0x7f235d432910, record=0x7f235d503410 "\371\001")
at /data/users/yoshinori/mysql/5.6/sql/handler.h:2412
#2 0x00000000008ebfcb in Rows_log_event::do_index_scan_and_update (this=this@entry=0x7f235d48bf00, rli=rli@entry=
0x7f2363ba6000) at /data/users/yoshinori/mysql/5.6/sql/log_event.cc:10825
#3 0x00000000008eb18e in Rows_log_event::do_apply_event (this=0x7f235d48bf00, rli=0x7f2363ba6000)
at /data/users/yoshinori/mysql/5.6/sql/log_event.cc:11709
#4 0x00000000008ee2b7 in Log_event::apply_event (this=this@entry=0x7f235d48bf00, rli=rli@entry=0x7f2363ba6000)
at /data/users/yoshinori/mysql/5.6/sql/log_event.cc:3345
#5 0x0000000000918d8c in apply_event_and_update_pos (ptr_ev=ptr_ev@entry=0x7f2386eac670, thd=thd@entry=
0x7f235d429000, rli=rli@entry=0x7f2363ba6000) at /data/users/yoshinori/mysql/5.6/sql/rpl_slave.cc:3575
#6 0x000000000091bf89 in exec_relay_log_event (rli=0x7f2363ba6000, thd=0x7f235d429000)
at /data/users/yoshinori/mysql/5.6/sql/rpl_slave.cc:4122

last_rowkey was null.
(gdb) p ref
$1 = (uchar *) 0x7f235d503738 ""
(gdb) p last_rowkey
$2 = {Ptr = 0x0, str_length = 0, Alloced_length = 0, alloced = false, str_charset = 0x15d1a60 }
(gdb) p ref_length
$3 = 8

@yoshinorim yoshinorim added the bug label
@spetrunia spetrunia was assigned by yoshinorim
@yoshinorim
Owner

This crash happened on slaves when using row based binary logging. ha_rocksdb::position() was called without setting last_rowkey. I think it is necessary to compose key string from record argument. ha_innobase::store_key_val_for_row() does such things.

@yoshinorim yoshinorim changed the title from slave crash on update to slave crash on update with row based binary logging
@spetrunia
Collaborator
@spetrunia spetrunia referenced this issue from a commit
@spetrunia spetrunia Fix issue #18: slave crash on update with row based binary logging
Summary:
ha_rocksdb::position() should not return rowid of the last read row,
it should get the rowid of the record passed as parameter.

Test Plan: ./mtr --suite=rocksdb && ./mtr t/rocksdb*test

Reviewers: yoshinorim

Reviewed By: yoshinorim

Subscribers: hermanlee4, maykov, jonahcohen

Differential Revision: https://reviews.facebook.net/D31983
fabd0d9
@spetrunia
Collaborator

Fix pushed

@spetrunia spetrunia closed this
@spetrunia spetrunia referenced this issue from a commit
@spetrunia spetrunia Fix issue #18: slave crash on update with row based binary logging
Summary:
ha_rocksdb::position() should not return rowid of the last read row,
it should get the rowid of the record passed as parameter.

Test Plan: ./mtr --suite=rocksdb && ./mtr t/rocksdb*test

Reviewers: yoshinorim

Reviewed By: yoshinorim

Subscribers: hermanlee4, maykov, jonahcohen

Differential Revision: https://reviews.facebook.net/D31983
0e32f79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.