revert related threshold for bmsql perf and fix mem monitor

This commit is contained in:
obdev
2024-02-21 04:15:56 +00:00
committed by ob-robot
parent 1b5bd8d4b4
commit e1d63f0600
4 changed files with 14 additions and 12 deletions

View File

@ -1578,6 +1578,7 @@ ObTenantDagWorker::ObTenantDagWorker()
function_type_(0), function_type_(0),
group_id_(0), group_id_(0),
tg_id_(-1), tg_id_(-1),
hold_by_compaction_dag_(false),
is_inited_(false) is_inited_(false)
{ {
} }
@ -1710,14 +1711,15 @@ bool ObTenantDagWorker::get_force_cancel_flag()
return flag; return flag;
} }
bool ObTenantDagWorker::hold_by_compaction_dag() void ObTenantDagWorker::set_task(ObITask *task)
{ {
bool bret = false; task_ = task;
hold_by_compaction_dag_ = false;
ObIDag *dag = nullptr; ObIDag *dag = nullptr;
if (OB_NOT_NULL(task_) && OB_NOT_NULL(dag = task_->get_dag())) { if (OB_NOT_NULL(task_) && OB_NOT_NULL(dag = task_->get_dag())) {
bret = is_compaction_dag(dag->get_type()); hold_by_compaction_dag_ = is_compaction_dag(dag->get_type());
} }
return bret;
} }
void ObTenantDagWorker::run1() void ObTenantDagWorker::run1()

View File

@ -707,7 +707,7 @@ public:
void resume(); void resume();
void run1() override; void run1() override;
int yield(); int yield();
void set_task(ObITask *task) { task_ = task; } void set_task(ObITask *task);
void set_function_type(const int64_t function_type) { function_type_ = function_type; } void set_function_type(const int64_t function_type) { function_type_ = function_type; }
int set_dag_resource(const uint64_t group_id); int set_dag_resource(const uint64_t group_id);
bool need_wake_up() const; bool need_wake_up() const;
@ -720,10 +720,10 @@ public:
static void set_mem_ctx(compaction::ObCompactionMemoryContext *mem_ctx) { if (nullptr == mem_ctx_) { mem_ctx_ = mem_ctx; } } static void set_mem_ctx(compaction::ObCompactionMemoryContext *mem_ctx) { if (nullptr == mem_ctx_) { mem_ctx_ = mem_ctx; } }
uint64_t get_group_id() { return group_id_; } uint64_t get_group_id() { return group_id_; }
bool get_force_cancel_flag(); bool get_force_cancel_flag();
bool hold_by_compaction_dag(); bool hold_by_compaction_dag() const { return hold_by_compaction_dag_; }
private: private:
void notify(DagWorkerStatus status); void notify(DagWorkerStatus status);
void reset_compaction_thread_locals() { is_reserve_mode_ = false; mem_ctx_ = nullptr; } void reset_compaction_thread_locals() { is_reserve_mode_ = false; mem_ctx_ = nullptr; hold_by_compaction_dag_ = false; }
private: private:
RLOCAL_STATIC(ObTenantDagWorker *, self_); RLOCAL_STATIC(ObTenantDagWorker *, self_);
RLOCAL_STATIC(bool, is_reserve_mode_); RLOCAL_STATIC(bool, is_reserve_mode_);
@ -738,6 +738,7 @@ private:
int64_t function_type_; int64_t function_type_;
uint64_t group_id_; uint64_t group_id_;
int tg_id_; int tg_id_;
bool hold_by_compaction_dag_;
bool is_inited_; bool is_inited_;
}; };
@ -1427,7 +1428,7 @@ inline bool is_reserve_mode()
worker->set_mem_ctx(&mem_ctx); \ worker->set_mem_ctx(&mem_ctx); \
} else if (REACH_TENANT_TIME_INTERVAL(30 * 1000 * 1000L/*30s*/)) { \ } else if (REACH_TENANT_TIME_INTERVAL(30 * 1000 * 1000L/*30s*/)) { \
COMMON_LOG_RET(WARN, OB_ERR_UNEXPECTED, \ COMMON_LOG_RET(WARN, OB_ERR_UNEXPECTED, \
"only compaction dag can set memctx", KPC(worker)); \ "only compaction dag can set memctx", K(worker)); \
} \ } \
} \ } \
}) })
@ -1441,7 +1442,7 @@ inline bool is_reserve_mode()
mem_ctx = worker->get_mem_ctx(); \ mem_ctx = worker->get_mem_ctx(); \
} else if (REACH_TENANT_TIME_INTERVAL(30 * 1000 * 1000L/*30s*/)) { \ } else if (REACH_TENANT_TIME_INTERVAL(30 * 1000 * 1000L/*30s*/)) { \
COMMON_LOG_RET(WARN, OB_ERR_UNEXPECTED, \ COMMON_LOG_RET(WARN, OB_ERR_UNEXPECTED, \
"memctx only provided for compaction dag", KPC(worker)); \ "memctx only provided for compaction dag", K(worker)); \
} \ } \
} \ } \
mem_ctx; \ mem_ctx; \

View File

@ -281,9 +281,8 @@ private:
AdaptiveMergeReason &merge_reason); AdaptiveMergeReason &merge_reason);
public: public:
static constexpr int64_t SCHEDULE_META_MERGE_INTERVAL = 120L * 1000L * 1000L; //120s
static constexpr int64_t INC_ROW_COUNT_THRESHOLD = 100L * 1000L; // 10w static constexpr int64_t INC_ROW_COUNT_THRESHOLD = 100L * 1000L; // 10w
static constexpr int64_t TOMBSTONE_ROW_COUNT_THRESHOLD = 30L * 1000L; // 3w static constexpr int64_t TOMBSTONE_ROW_COUNT_THRESHOLD = 200L * 1000L; // 20w
static constexpr int64_t BASE_ROW_COUNT_THRESHOLD = 10L * 1000L; // 1w static constexpr int64_t BASE_ROW_COUNT_THRESHOLD = 10L * 1000L; // 1w
static constexpr int64_t LOAD_DATA_SCENE_THRESHOLD = 70; static constexpr int64_t LOAD_DATA_SCENE_THRESHOLD = 70;
static constexpr int64_t TOMBSTONE_SCENE_THRESHOLD = 50; static constexpr int64_t TOMBSTONE_SCENE_THRESHOLD = 50;

View File

@ -73,7 +73,7 @@ private:
const int64_t memtable_create_timestamp, const int64_t memtable_create_timestamp,
int64_t &adaptive_threshold); int64_t &adaptive_threshold);
private: private:
static const int64_t FAST_FREEZE_INTERVAL_US = 120 * 1000 * 1000L; //120s static const int64_t FAST_FREEZE_INTERVAL_US = 300 * 1000 * 1000L; //300s
static const int64_t PRINT_LOG_INVERVAL = 2 * 60 * 1000 * 1000L; // 2m static const int64_t PRINT_LOG_INVERVAL = 2 * 60 * 1000 * 1000L; // 2m
static const int64_t TOMBSTONE_DEFAULT_ROW_COUNT = 250000; static const int64_t TOMBSTONE_DEFAULT_ROW_COUNT = 250000;
static const int64_t TOMBSTONE_MAX_ROW_COUNT = 500000; static const int64_t TOMBSTONE_MAX_ROW_COUNT = 500000;