Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

slave crash on update with row based binary logging #18

Closed
yoshinorim opened this issue Jan 9, 2015 · 3 comments
Closed

slave crash on update with row based binary logging #18

yoshinorim opened this issue Jan 9, 2015 · 3 comments
Assignees
Labels

Comments

@yoshinorim
Copy link

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 <my_charset_bin>}
(gdb) p ref_length
$3 = 8

@yoshinorim
Copy link
Author

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 slave crash on update slave crash on update with row based binary logging Jan 14, 2015
@spetrunia
Copy link

The patch is here: https://reviews.facebook.net/D31983

spetrunia added a commit that referenced this issue Jan 27, 2015
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
@spetrunia
Copy link

Fix pushed

spetrunia added a commit that referenced this issue Aug 27, 2015
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants