Skip to content

Commit

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

Reviewed By: Pushapgl

Differential Revision: D39115879

Pulled By: yoshinorim

fbshipit-source-id: 40e7bcb
  • Loading branch information
rockeet authored and inikep committed May 15, 2023
1 parent bc2c16a commit ca5ccb8
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 @@ -4407,7 +4407,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 @@ -4859,6 +4864,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 @@ -4983,6 +4990,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 ca5ccb8

Please sign in to comment.