From 238afbb8c08140623a752d2dbd0a5a07a78ad027 Mon Sep 17 00:00:00 2001 From: leipeng Date: Mon, 29 Aug 2022 15:39:46 -0700 Subject: [PATCH] set m_read_opts.ignore_range_deletions properly (#1218) Summary: ignore_range_deletions should be set to true when range del is not enabled Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/1218 Reviewed By: Pushapgl Differential Revision: D39115879 Pulled By: yoshinorim fbshipit-source-id: 40e7bcb86590c8f9be44dfa3f74277fb3f49a6d5 --- storage/rocksdb/ha_rocksdb.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 681c6e92a81b..aa1628259d10 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -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 @@ -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(); @@ -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; }