Fixed the issue where memory could not be reused when reading interme results

Co-authored-by: sdc <njucssdc@gmail.com>
This commit is contained in:
qingsuijiu
2024-01-23 12:42:27 +00:00
committed by ob-robot
parent b17c899823
commit 2f8fa89e0c
3 changed files with 39 additions and 10 deletions

View File

@ -288,7 +288,14 @@ int ObTempBlockStore::append_block_payload(const char *buf, const int64_t size,
MEMCPY(blk_->payload_, buf, size);
block_id_cnt_ = blk_->end();
blk_->get_buffer()->fast_advance(size);
LOG_DEBUG("append block payload", K(*this), K(*blk_));
LOG_DEBUG("append block payload", K(*this), K(*blk_), K(mem_used_), K(mem_hold_));
}
// dump data if mem used > 16MB
const int64_t dump_threshold = 1 << 24;
if (OB_SUCC(ret) && mem_used_ > dump_threshold) {
if (OB_FAIL(dump(false /* reuse */, true /* all_dump */))) {
LOG_WARN("dump failed", K(ret));
}
}
return ret;
}