fix small sstable reuse
This commit is contained in:
parent
0fe424c626
commit
b5daff8f95
12
src/share/cache/ob_kvcache_map.cpp
vendored
12
src/share/cache/ob_kvcache_map.cpp
vendored
@ -273,8 +273,8 @@ int ObKVCacheMap::get(
|
||||
iter = bucket_ptr;
|
||||
bool is_equal = false;
|
||||
while (NULL != iter && OB_SUCC(ret)) {
|
||||
if (store_->add_handle_ref(iter->mb_handle_, iter->seq_num_)) {
|
||||
if (hash_code == iter->hash_code_) {
|
||||
if (hash_code == iter->hash_code_) {
|
||||
if (store_->add_handle_ref(iter->mb_handle_, iter->seq_num_)) {
|
||||
if (OB_FAIL(key.equal(*iter->key_, is_equal))) {
|
||||
COMMON_LOG(WARN, "Failed to check kvcache key equal", K(ret));
|
||||
} else if (is_equal) {
|
||||
@ -290,8 +290,8 @@ int ObKVCacheMap::get(
|
||||
|
||||
break;
|
||||
}
|
||||
store_->de_handle_ref(iter->mb_handle_);
|
||||
}
|
||||
store_->de_handle_ref(iter->mb_handle_);
|
||||
}
|
||||
iter = iter->next_;
|
||||
}
|
||||
@ -310,8 +310,8 @@ int ObKVCacheMap::get(
|
||||
iter = bucket_ptr;
|
||||
bool is_equal = false;
|
||||
while (NULL != iter && OB_LIKELY(OB_SUCCESS == tmp_ret)) {
|
||||
if (store_->add_handle_ref(iter->mb_handle_, iter->seq_num_)) {
|
||||
if (hash_code == iter->hash_code_) {
|
||||
if (hash_code == iter->hash_code_) {
|
||||
if (store_->add_handle_ref(iter->mb_handle_, iter->seq_num_)) {
|
||||
if (OB_TMP_FAIL(key.equal(*iter->key_, is_equal))) {
|
||||
COMMON_LOG(WARN, "Failed to check kvcache key equal", K(tmp_ret));
|
||||
} else if (is_equal) {
|
||||
@ -322,8 +322,8 @@ int ObKVCacheMap::get(
|
||||
store_->de_handle_ref(old_handle);
|
||||
break;
|
||||
}
|
||||
store_->de_handle_ref(iter->mb_handle_);
|
||||
}
|
||||
store_->de_handle_ref(iter->mb_handle_);
|
||||
}
|
||||
prev = iter;
|
||||
iter = iter->next_;
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
access_ctx_(nullptr),
|
||||
sstable_(nullptr),
|
||||
allocator_(common::ObModIds::OB_SSTABLE_READER, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()),
|
||||
io_buf_(),
|
||||
prefetch_macro_cursor_(0),
|
||||
cur_macro_cursor_(0),
|
||||
is_macro_prefetch_end_(false),
|
||||
@ -66,8 +67,7 @@ public:
|
||||
is_inited_(false),
|
||||
last_micro_block_recycled_(false),
|
||||
last_mvcc_row_already_output_(false),
|
||||
iter_macro_cnt_(0),
|
||||
io_buf_()
|
||||
iter_macro_cnt_(0)
|
||||
{}
|
||||
|
||||
virtual ~ObSSTableRowWholeScanner();
|
||||
@ -125,6 +125,7 @@ private:
|
||||
blocksstable::ObSSTable *sstable_;
|
||||
blocksstable::ObDatumRange query_range_;
|
||||
common::ObArenaAllocator allocator_;
|
||||
compaction::ObCompactionBuffer io_buf_[PREFETCH_DEPTH];
|
||||
int64_t prefetch_macro_cursor_;
|
||||
int64_t cur_macro_cursor_;
|
||||
bool is_macro_prefetch_end_;
|
||||
@ -138,7 +139,6 @@ private:
|
||||
bool last_micro_block_recycled_;
|
||||
bool last_mvcc_row_already_output_;
|
||||
int64_t iter_macro_cnt_;
|
||||
compaction::ObCompactionBuffer io_buf_[PREFETCH_DEPTH];
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ int ObTabletMergeInfo::create_sstable(
|
||||
if (OB_SUCC(ret)) {
|
||||
// if base sstable is small sstable and was reused, we disable the small sstable optimization
|
||||
const ObSSTable *sstable = static_cast<const ObSSTable*>(tables_handle.get_table(0));
|
||||
const bool is_reused_small_sst = is_major_merge_type(ctx.get_merge_type())
|
||||
const bool is_reused_small_sst = is_major_or_meta_merge_type(ctx.get_merge_type())
|
||||
&& nullptr == cg_schema //row store mode
|
||||
&& sstable->is_small_sstable()
|
||||
&& 1 == sstable_merge_info_.macro_block_count_
|
||||
|
Loading…
x
Reference in New Issue
Block a user