From 0dabb16deca907562b80936878685ae5e29bef5b Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 3 Oct 2022 15:02:15 +0000 Subject: [PATCH] [CP] set ArcClogTask count upper limit --- src/archive/ob_archive_allocator.cpp | 9 ++++++++- src/archive/ob_log_archive_define.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/archive/ob_archive_allocator.cpp b/src/archive/ob_archive_allocator.cpp index 181ed54ba..9ee7b2658 100644 --- a/src/archive/ob_archive_allocator.cpp +++ b/src/archive/ob_archive_allocator.cpp @@ -13,6 +13,7 @@ #include "ob_log_archive_struct.h" #include "ob_archive_allocator.h" #include "ob_archive_task_queue.h" +#include "ob_log_archive_define.h" #include "lib/ob_running_mode.h" // is_mini_mode using namespace oceanbase; @@ -35,12 +36,18 @@ int ObArchiveAllocator::init() const int64_t clog_task_size = sizeof(ObPGArchiveCLogTask); const int64_t clog_task_status_size = sizeof(ObArchiveCLogTaskStatus); const int64_t send_task_status_size = sizeof(ObArchiveSendTaskStatus); + const int64_t DEFAULT_MIN_OBJ_COUNT_ON_BLOCK = 1; const int64_t UNUSED_HOLD_LIMIT = 0; if (OB_UNLIKELY(inited_)) { ret = OB_INIT_TWICE; ARCHIVE_LOG(ERROR, "ObArchiveAllocator has been inited", KR(ret)); - } else if (OB_FAIL(clog_task_allocator_.init(clog_task_size, "ArcCLogTask"))) { + } else if (OB_FAIL(clog_task_allocator_.init(clog_task_size, + "ArcCLogTask", + common::OB_SERVER_TENANT_ID, + common::OB_MALLOC_NORMAL_BLOCK_SIZE, + DEFAULT_MIN_OBJ_COUNT_ON_BLOCK, + MAX_ARCHIVE_TASK_COUNT_LIMIT))) { ARCHIVE_LOG(WARN, "clog_task_allocator_ init fail", KR(ret)); } else if (OB_FAIL(send_task_allocator_.init(SEND_TASK_CAPACITY_LIMIT, UNUSED_HOLD_LIMIT, SEND_TASK_PAGE_SIZE))) { ARCHIVE_LOG(WARN, "send_task_allocator_ init fail", KR(ret)); diff --git a/src/archive/ob_log_archive_define.h b/src/archive/ob_log_archive_define.h index cefe687f1..4e895a62c 100644 --- a/src/archive/ob_log_archive_define.h +++ b/src/archive/ob_log_archive_define.h @@ -51,6 +51,7 @@ static const int64_t SEND_TASK_CAPACITY_LIMIT = 1 * 1024 * 1024 * 1024L; // 1G static const int64_t SEND_TASK_PAGE_SIZE = common::OB_MALLOC_MIDDLE_BLOCK_SIZE; static const int64_t ARCHIVE_THREAD_WAIT_INTERVAL = 100 * 1000L; static const int64_t MAX_ARCHIVE_THREAD_NAME_LENGTH = 50; +static const int64_t MAX_ARCHIVE_TASK_COUNT_LIMIT = 500 * 1000L; static const int64_t MAX_ARCHIVE_TASK_STATUS_QUEUE_CAPACITY = common::OB_MAX_PARTITION_NUM_PER_SERVER; static const int64_t MAX_ARCHIVE_TASK_STATUS_POP_TIMEOUT = 100 * 1000L; -- GitLab