facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.

Home Page:http://myrocks.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deleting rows fails to replicate

ldonoso opened this issue · comments

The replication of deleted rows as in:

connection master;
DELETE FROM t1 WHERE C1 = C2;
SELECT * FROM t1 ORDER BY C1,C2;
--source include/sync_slave_sql_with_master.inc
SELECT * FROM t1 ORDER BY C1,C2;

fails with:

T@12: | | | | | | >Rows_log_event::do_scan_and_update
T@12: | | | | | | | info: Hash was populated with 2 records!
T@12: | | | | | | | >Rows_log_event::open_record_scan
T@12: | | | | | | | | info: locating record using a key (index_read)
T@12: | | | | | | | | >handler::ha_index_init
T@12: | | | | | | | | | >virtual int myrocks::ha_rocksdb::index_init(uint, bool)
T@12: | | | | | | | | | <virtual int myrocks::ha_rocksdb::index_init(uint, bool) 10832
T@12: | | | | | | | | <handler::ha_index_init
T@12: | | | | | | | <Rows_log_event::open_record_scan
T@12: | | | | | | | >Rows_log_event::next_record_scan
...
T@12: | | | | | | | <Rows_log_event::next_record_scan
T@12: | | | | | | | >Hash_slave_rows::get
T@12: | | | | | | | | >Hash_slave_rows::make_hash_key
T@12: | | | | | | | | <Hash_slave_rows::make_hash_key
T@12: | | | | | | | <Hash_slave_rows::get
T@12: | | | | | | | >Rows_log_event::next_record_scan
...
T@12: | | | | | | | <Rows_log_event::next_record_scan
T@12: | | | | | | | >Hash_slave_rows::get
T@12: | | | | | | | | >Hash_slave_rows::make_hash_key
T@12: | | | | | | | | <Hash_slave_rows::make_hash_key
T@12: | | | | | | | <Hash_slave_rows::get
T@12: | | | | | | | >Rows_log_event::next_record_scan
T@12: | | | | | | | | >handler::ha_index_next_same
T@12: | | | | | | | | | >virtual int myrocks::ha_rocksdb::index_next_same(uchar*, const uchar*, uint)
T@12: | | | | | | | | | <virtual int myrocks::ha_rocksdb::index_next_same(uchar*, const uchar*, uint) 9225
T@12: | | | | | | | | <handler::ha_index_next_same
T@12: | | | | | | | <Rows_log_event::next_record_scan
T@12: | | | | | | | info: error: HA_ERR_KEY_NOT_FOUND
T@12: | | | | | | | >void handler::print_error
T@12: | | | | | | | | enter: error: 120
T@12: | | | | | | | | >my_error
T@12: | | | | | | | | | >my_message_sql
T@12: | | | | | | | | | | error: error: 1032  message: 'Can't find record in 't1''

Please, find attached test showing the issue: rpl_rocdsdb_row_basic.tar.gz

Probably cause:

ha_rocksdb::index_next_same doesn't play well with Rows_log_event::next_record_scan. ha_rocksdb::index_next_same always fails when m_full_key_lookup is true.

The issue is a regression which might have been introduced in f35c50e