diff --git a/src/share/allocator/ob_gmemstore_allocator.cpp b/src/share/allocator/ob_gmemstore_allocator.cpp index 4aeda40447..11a3b6c00a 100644 --- a/src/share/allocator/ob_gmemstore_allocator.cpp +++ b/src/share/allocator/ob_gmemstore_allocator.cpp @@ -98,7 +98,9 @@ void* ObGMemstoreAllocator::alloc(AllocHandle& handle, int64_t size) if (!handle.is_id_valid()) { COMMON_LOG(TRACE, "MTALLOC.first_alloc", KP(&handle.mt_)); LockGuard guard(lock_); - if (!handle.is_id_valid()) { + if (handle.is_frozen()) { + COMMON_LOG(ERROR, "cannot alloc because allocator is frozen", K(ret), K(handle.mt_)); + } else if (!handle.is_id_valid()) { handle.set_clock(arena_.retired()); hlist_.set_active(handle); } diff --git a/src/share/allocator/ob_handle_list.h b/src/share/allocator/ob_handle_list.h index 74680a7a76..f0f9720a9e 100644 --- a/src/share/allocator/ob_handle_list.h +++ b/src/share/allocator/ob_handle_list.h @@ -116,6 +116,7 @@ public: } void set_frozen() { ATOMIC_STORE(&freeze_stat_, FROZEN); } bool is_active() const { return ATOMIC_LOAD(&freeze_stat_) == ACTIVE; } + bool is_frozen() const { return ATOMIC_LOAD(&freeze_stat_) == FROZEN; } TO_STRING_KV(K_(freeze_stat), K_(id), K_(clock)); }; ObHandleList(): id_(0), hazard_(INT64_MAX), total_count_(0) {