Skip to content

Commit

Permalink
[mysql-5.6][PR] set m_read_opts.ignore_range_deletions properly
Browse files Browse the repository at this point in the history
Summary:
ignore_range_deletions should be set to true when range del is not enabled

Pull Request resolved: facebook#1218
GitHub Author: leipeng <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.

Reviewers: pgl

Reviewed By: pgl

Subscribers: pgl, [email protected]

Differential Revision: https://phabricator.intern.facebook.com/D39115879

Tags: accept2ship
  • Loading branch information
Yoshinori Matsunobu authored and Herman Lee committed Nov 4, 2022
1 parent 8d4f7ff commit 40e7bcb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4406,7 +4406,12 @@ class Rdb_transaction {
}

explicit Rdb_transaction(THD *const thd)
: m_thd(thd), m_tbl_io_perf(nullptr) {}
: m_thd(thd), m_tbl_io_perf(nullptr) {
m_read_opts[INTRINSIC_TMP].ignore_range_deletions =
!rocksdb_enable_delete_range_for_drop_index;
m_read_opts[USER_TABLE].ignore_range_deletions =
!rocksdb_enable_delete_range_for_drop_index;
}

virtual ~Rdb_transaction() {
#ifndef NDEBUG
Expand Down Expand Up @@ -4858,6 +4863,8 @@ class Rdb_transaction_impl : public Rdb_transaction {
m_rocksdb_reuse_tx[table_type] = nullptr;

m_read_opts[table_type] = rocksdb::ReadOptions();
m_read_opts[table_type].ignore_range_deletions =
!rocksdb_enable_delete_range_for_drop_index;

set_initial_savepoint();

Expand Down Expand Up @@ -4982,6 +4989,8 @@ class Rdb_writebatch_impl : public Rdb_transaction {
void reset() {
m_batch->Clear();
m_read_opts[USER_TABLE] = rocksdb::ReadOptions();
m_read_opts[USER_TABLE].ignore_range_deletions =
!rocksdb_enable_delete_range_for_drop_index;
m_ddl_transaction = false;
}

Expand Down

0 comments on commit 40e7bcb

Please sign in to comment.