Add defensive log in ObGMemstoreAllocator::alloc
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user