[bugfix]: in datumstorewrapper, block_reader is reset twice.
This commit is contained in:
@ -395,11 +395,11 @@ void ObCompactStore::reset()
|
|||||||
{
|
{
|
||||||
if (OB_NOT_NULL(reader_)) {
|
if (OB_NOT_NULL(reader_)) {
|
||||||
reader_->reset();
|
reader_->reset();
|
||||||
allocator_->free(reader_);
|
get_inner_allocator().free(reader_);
|
||||||
}
|
}
|
||||||
if (OB_NOT_NULL(writer_)) {
|
if (OB_NOT_NULL(writer_)) {
|
||||||
writer_->reset();
|
writer_->reset();
|
||||||
allocator_->free(writer_);
|
get_inner_allocator().free(writer_);
|
||||||
}
|
}
|
||||||
writer_ = nullptr;
|
writer_ = nullptr;
|
||||||
reader_ = nullptr;
|
reader_ = nullptr;
|
||||||
@ -428,8 +428,8 @@ int ObCompactStore::init_writer_reader()
|
|||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
void *writer_buf = nullptr;
|
void *writer_buf = nullptr;
|
||||||
void *reader_buf = nullptr;
|
void *reader_buf = nullptr;
|
||||||
writer_buf = allocator_->alloc(sizeof(ObCompactBlockWriter));
|
writer_buf = get_inner_allocator().alloc(sizeof(ObCompactBlockWriter));
|
||||||
reader_buf = allocator_->alloc(sizeof(ObCompactBlockReader));
|
reader_buf = get_inner_allocator().alloc(sizeof(ObCompactBlockReader));
|
||||||
if (OB_ISNULL(writer_buf) || OB_ISNULL(reader_buf)) {
|
if (OB_ISNULL(writer_buf) || OB_ISNULL(reader_buf)) {
|
||||||
ret = OB_ALLOCATE_MEMORY_FAILED;
|
ret = OB_ALLOCATE_MEMORY_FAILED;
|
||||||
LOG_WARN("fail to allocate memory for writer", K(ret));
|
LOG_WARN("fail to allocate memory for writer", K(ret));
|
||||||
|
|||||||
@ -396,6 +396,7 @@ public:
|
|||||||
inline int64_t get_file_size() const { return file_size_; }
|
inline int64_t get_file_size() const { return file_size_; }
|
||||||
inline int64_t get_max_blk_size() const { return max_block_size_; }
|
inline int64_t get_max_blk_size() const { return max_block_size_; }
|
||||||
inline int64_t get_max_hold_mem() const { return max_hold_mem_; }
|
inline int64_t get_max_hold_mem() const { return max_hold_mem_; }
|
||||||
|
inline ObIAllocator& get_inner_allocator() { return inner_allocator_; }
|
||||||
inline int64_t has_dumped() const { return block_cnt_on_disk_ > 0; }
|
inline int64_t has_dumped() const { return block_cnt_on_disk_ > 0; }
|
||||||
inline int64_t get_last_buffer_mem_size() const
|
inline int64_t get_last_buffer_mem_size() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1800,7 +1800,7 @@ int ObSortOpImpl::build_ems_heap(int64_t &merge_ways)
|
|||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
ObSortOpChunk *chunk = sort_chunks_.get_first();
|
ObSortOpChunk *chunk = sort_chunks_.get_first();
|
||||||
for (int64_t i = 0; i < merge_ways && OB_SUCC(ret); i++) {
|
for (int64_t i = 0; i < merge_ways && OB_SUCC(ret); i++) {
|
||||||
chunk->datum_store_.reset();
|
chunk->datum_store_.reset_iter();
|
||||||
if (OB_FAIL(chunk->datum_store_.get_next_row(chunk->row_))
|
if (OB_FAIL(chunk->datum_store_.get_next_row(chunk->row_))
|
||||||
|| NULL == chunk->row_) {
|
|| NULL == chunk->row_) {
|
||||||
if (OB_ITER_END == ret || OB_SUCCESS == ret) {
|
if (OB_ITER_END == ret || OB_SUCCESS == ret) {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public:
|
|||||||
return is_compact_ ? compact_store_.get_mem_hold() : datum_store_.get_mem_hold();
|
return is_compact_ ? compact_store_.get_mem_hold() : datum_store_.get_mem_hold();
|
||||||
}
|
}
|
||||||
|
|
||||||
int reset()
|
int reset_iter()
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (is_compact_) {
|
if (is_compact_) {
|
||||||
|
|||||||
@ -525,6 +525,7 @@ int ObChunkSliceStore::prepare_datum_stores(const uint64_t tenant_id, ObTabletHa
|
|||||||
LOG_WARN("failed to init chunk datum store", K(ret));
|
LOG_WARN("failed to init chunk datum store", K(ret));
|
||||||
} else {
|
} else {
|
||||||
datum_store->set_dir_id(dir_id);
|
datum_store->set_dir_id(dir_id);
|
||||||
|
datum_store->set_allocator(allocator);
|
||||||
LOG_INFO("set dir id", K(dir_id));
|
LOG_INFO("set dir id", K(dir_id));
|
||||||
}
|
}
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user