Skip to content

Commit

Permalink
set m_read_opts.ignore_range_deletions properly (#1218)
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: #1218

Reviewed By: Pushapgl

Differential Revision: D39115879

Pulled By: yoshinorim

fbshipit-source-id: 40e7bcb
  • Loading branch information
rockeet authored and facebook-github-bot committed Aug 29, 2022
1 parent 5da4d2b commit 238afbb
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 238afbb

Please sign in to comment.