[CP] [Fix] ttl delete

This commit is contained in:
IHEII
2023-10-20 02:43:10 +00:00
committed by ob-robot
parent f0e0bdbe38
commit e4a6af9207

View File

@ -512,7 +512,13 @@ int ObTableTTLDeleteRowIterator::get_next_row(ObNewRow*& row)
LOG_DEBUG("finish get next row", KR(ret), K(cur_del_rows_), K(limit_del_rows_));
} else {
bool is_expired = false;
while(OB_SUCC(ret) && !is_expired && OB_SUCC(ObTableApiScanRowIterator::get_next_row(row, false/*need_deep_copy*/))) {
while(OB_SUCC(ret) && !is_expired) {
if (OB_FAIL(ObTableApiScanRowIterator::get_next_row(row, false/*need_deep_copy*/))) {
if (OB_ITER_END != ret) {
LOG_WARN("fail to get next row", K(ret));
}
last_row_ = nullptr;
} else {
last_row_ = row;
// NOTE: For hbase table, the row expired if and only if
// 1. The row's version exceed maxversion
@ -559,6 +565,7 @@ int ObTableTTLDeleteRowIterator::get_next_row(ObNewRow*& row)
}
}
}
}
if (OB_FAIL(ret)) {
if (ret != OB_ITER_END) {
@ -658,6 +665,7 @@ int ObTableTTLDeleteTask::execute_ttl_delete(ObTableTTLDeleteRowIterator &ttl_ro
}
if (OB_SUCC(ret) && rowkey_.is_valid()) {
// if ITER_END in ttl_row_iter, rowkey_ will not be assigned by last_row_ in this round
uint64_t buf_len = rowkey_.get_serialize_size();
char *buf = static_cast<char *>(allocator_.alloc(buf_len));
int64_t pos = 0;