revision-id: 35466886f73da355c90f567956f5539591daaf05 (fb-prod201801-403-g35466886f73) parent(s): 849ffd203abbb9103d683c76689bd8bae1de92b1 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-08-19 19:47:59 +0300 message: MDEV-19986: MyRocks: Range Locking: SeekForUpdate support Code cleanup. --- storage/rocksdb/ha_rocksdb.cc | 6 ++++-- storage/rocksdb/rdb_locking_iter.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 3cd923f96c0..b013ab94a0d 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8957,7 +8957,8 @@ int ha_rocksdb::index_first_intern(uchar *const buf) { // snapshot here (i.e. it did not exist prior to this) for (;;) { setup_scan_iterator(kd, &index_key, false, key_start_matching_bytes, - (m_lock_rows != RDB_LOCK_NONE && !end_range)); + (rocksdb_use_range_locking && + m_lock_rows != RDB_LOCK_NONE && !end_range)); m_scan_it->Seek(index_key); m_skip_scan_it_next_call = true; @@ -9048,7 +9049,8 @@ int ha_rocksdb::index_last_intern(uchar *const buf) { // snapshot here (i.e. it did not exist prior to this) for (;;) { setup_scan_iterator(kd, &index_key, false, key_end_matching_bytes, - (m_lock_rows != RDB_LOCK_NONE && !end_range)); + (rocksdb_use_range_locking && + m_lock_rows != RDB_LOCK_NONE && !end_range)); m_scan_it->SeekForPrev(index_key); m_skip_scan_it_next_call = false; diff --git a/storage/rocksdb/rdb_locking_iter.h b/storage/rocksdb/rdb_locking_iter.h index d36560f75cd..632915d4b3d 100644 --- a/storage/rocksdb/rdb_locking_iter.h +++ b/storage/rocksdb/rdb_locking_iter.h @@ -49,6 +49,10 @@ class LockingIterator : public rocksdb::Iterator { txn_(txn), cfh_(cfh), read_opts_(opts), iter_(nullptr), status_(rocksdb::Status::InvalidArgument()), valid_(false) {} + ~LockingIterator() { + delete iter_; + } + virtual bool Valid() const override { return valid_; } // Note: MyRocks doesn't ever call these: