[CP] logger opt
This commit is contained in:
2
deps/oblib/src/lib/allocator/ob_ctx_define.h
vendored
2
deps/oblib/src/lib/allocator/ob_ctx_define.h
vendored
@ -39,7 +39,7 @@ public:
|
||||
PARALLEL_DEF(DEFAULT_CTX_ID, 32)
|
||||
PARALLEL_DEF(LIBEASY, 32)
|
||||
PARALLEL_DEF(PLAN_CACHE_CTX_ID, 4)
|
||||
PARALLEL_DEF(LOGGER_CTX_ID, 1)
|
||||
PARALLEL_DEF(LOGGER_CTX_ID, 4)
|
||||
#undef CTX_PARALLEL_DEF
|
||||
|
||||
#define ENABLE_DIRTY_LIST_DEF(name) ctx_attr_[ObCtxIds::name].enable_dirty_list_ = true;
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
#include "lib/ob_define.h"
|
||||
#include "lib/utility/ob_macro_utils.h"
|
||||
#include "lib/atomic/ob_atomic.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
@ -87,7 +88,11 @@ public:
|
||||
bool has_stopped() const { return has_stopped_; }
|
||||
virtual int64_t get_queued_item_cnt() const
|
||||
{
|
||||
return log_item_push_idx_ - log_item_pop_idx_;
|
||||
return ATOMIC_LOAD(&log_item_push_idx_) - ATOMIC_LOAD(&log_item_pop_idx_);
|
||||
}
|
||||
bool is_queue_full()
|
||||
{
|
||||
return get_queued_item_cnt() >= log_cfg_.max_buffer_item_cnt_;
|
||||
}
|
||||
protected:
|
||||
void flush_log();
|
||||
|
||||
2
deps/oblib/src/lib/oblog/ob_log.cpp
vendored
2
deps/oblib/src/lib/oblog/ob_log.cpp
vendored
@ -1558,7 +1558,7 @@ int ObLogger::init(const ObBaseLogWriterCfg &log_cfg,
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
allocator_->set_limit(limit);
|
||||
allocator_->set_nway(4);
|
||||
allocator_->set_nway(8);
|
||||
if (OB_FAIL(ObBaseLogWriter::init(log_cfg, thread_name))) {
|
||||
LOG_STDERR("init ObBaseLogWriter error. ret=%d\n", ret);
|
||||
} else if (OB_FAIL(ObBaseLogWriter::start())) {
|
||||
|
||||
4
deps/oblib/src/lib/oblog/ob_log.h
vendored
4
deps/oblib/src/lib/oblog/ob_log.h
vendored
@ -1233,7 +1233,9 @@ inline void ObLogger::do_log_message(const bool is_async,
|
||||
limited_left_log_size_ = 0;
|
||||
BASIC_TIME_GUARD(tg, "ObLog");
|
||||
int64_t start_ts = OB_TSC_TIMESTAMP.current_time();
|
||||
if (FD_TRACE_FILE != fd_type && OB_FAIL(check_tl_log_limiter(location_hash_val, level, errcode, log_size,
|
||||
if (is_queue_full()) {
|
||||
// do-nothing
|
||||
} else if (FD_TRACE_FILE != fd_type && OB_FAIL(check_tl_log_limiter(location_hash_val, level, errcode, log_size,
|
||||
allow, limiter_info))) {
|
||||
LOG_STDERR("precheck_tl_log_limiter error, ret=%d\n", ret);
|
||||
} else if (OB_UNLIKELY(!allow) && !need_print_log_limit_msg()) {
|
||||
|
||||
Reference in New Issue
Block a user