提交 d6ae24e6 编写于 作者: O obdev 提交者: wangzelin.wzl

Fix purge reset range issue when remain row

上级 99866eb9
...@@ -133,7 +133,6 @@ int ObMultipleScanMergeImpl::reset_range( ...@@ -133,7 +133,6 @@ int ObMultipleScanMergeImpl::reset_range(
gap_item.iter_idx_ = idx; gap_item.iter_idx_ = idx;
gap_item.row_ = &row; gap_item.row_ = &row;
int64_t remain_item = 0; int64_t remain_item = 0;
bool compare_result = false;
const ObIArray<ObITable*>& tables = tables_handle_.get_tables(); const ObIArray<ObITable*>& tables = tables_handle_.get_tables();
const int64_t tables_cnt = tables.count(); const int64_t tables_cnt = tables.count();
const ObScanMergeLoserTreeItem* top_item = nullptr; const ObScanMergeLoserTreeItem* top_item = nullptr;
...@@ -145,10 +144,12 @@ int ObMultipleScanMergeImpl::reset_range( ...@@ -145,10 +144,12 @@ int ObMultipleScanMergeImpl::reset_range(
STORAGE_LOG(WARN, "item or row is null", K(ret), KP(top_item)); STORAGE_LOG(WARN, "item or row is null", K(ret), KP(top_item));
} else { } else {
const bool is_memtable = tables.at(tables_cnt - top_item->iter_idx_ - 1)->is_memtable(); const bool is_memtable = tables.at(tables_cnt - top_item->iter_idx_ - 1)->is_memtable();
if (top_item->iter_idx_ < idx || const int64_t tree_ret = tree_cmp_(gap_item, *top_item);
(!is_memtable && if (top_item->iter_idx_ < idx
(compare_result = (tree_cmp_(gap_item, *top_item) < 0 || (!include_gap_key && 0 == compare_result))) && || (!is_memtable
OB_SUCCESS == tree_cmp_.get_error_code())) { // row in sstable is equal to or beyond gap row should be remained
&& (tree_ret < 0 || (include_gap_key && 0 == tree_ret))
&& OB_SUCCESS == tree_cmp_.get_error_code())) {
items[remain_item++] = *top_item; items[remain_item++] = *top_item;
} }
if (OB_FAIL(tree_cmp_.get_error_code())) { if (OB_FAIL(tree_cmp_.get_error_code())) {
...@@ -167,7 +168,7 @@ int ObMultipleScanMergeImpl::reset_range( ...@@ -167,7 +168,7 @@ int ObMultipleScanMergeImpl::reset_range(
"reset range compare", "reset range compare",
K(*gap_item.row_), K(*gap_item.row_),
K(*top_item->row_), K(*top_item->row_),
K(compare_result), K(tree_ret),
K(top_item->iter_idx_), K(top_item->iter_idx_),
K(idx), K(idx),
K(is_memtable)); K(is_memtable));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册