Fix a batch of memory not being split to tenant

This commit is contained in:
obdev
2023-05-18 14:11:18 +00:00
committed by ob-robot
parent 135383ca8b
commit 10ebab170d
98 changed files with 284 additions and 174 deletions

View File

@ -45,6 +45,7 @@ ObDedupQueue::ObDedupQueue() : is_inited_(false),
work_thread_num_(DEFAULT_THREAD_NUM),
thread_dead_threshold_(DEFALT_THREAD_DEAD_THRESHOLD),
hash_allocator_(allocator_),
bucket_allocator_(&allocator_),
gc_queue_head_(NULL),
gc_queue_tail_(NULL),
thread_name_(nullptr)
@ -89,7 +90,7 @@ int ObDedupQueue::init(const int64_t thread_num /*= DEFAULT_THREAD_NUM*/,
COMMON_LOG(WARN, "allocator init fail", K(page_size), K(label), K(tenant_id),
K(total_mem_limit), K(ret));
} else if (OB_SUCCESS != (ret = task_map_.create(task_map_size, &hash_allocator_,
ObModIds::OB_HASH_BUCKET_TASK_MAP))) {
&bucket_allocator_))) {
COMMON_LOG(WARN, "task_map create fail", K(ret));
} else if (OB_SUCCESS != (ret = task_queue_.init(queue_size, &allocator_))) {
COMMON_LOG(WARN, "task_queue init fail", K(ret));

View File

@ -189,7 +189,9 @@ private:
hash::MultiWriteDefendMode,
hash::hash_func<const IObDedupTask *>,
hash::equal_to<const IObDedupTask *>,
HashAllocator> TaskMap;
HashAllocator,
common::hash::NormalPointer,
common::ObWrapperAllocator> TaskMap;
typedef hash::HashMapTypes<const IObDedupTask *, IObDedupTask *>::pair_type TaskMapKVPair;
static const int32_t DEFAULT_THREAD_NUM = 4;
static const int32_t MAX_THREAD_NUM = 64;
@ -301,6 +303,7 @@ private:
int64_t thread_dead_threshold_;
ObConcurrentFIFOAllocator allocator_;
HashAllocator hash_allocator_;
common::ObWrapperAllocator bucket_allocator_;
TaskMap task_map_;
TaskQueue task_queue_;
ObThreadCond task_queue_sync_;