From 8c99697eb96235591c573461ada840a05e0ffb26 Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Thu, 21 Mar 2024 14:41:39 +0800 Subject: [PATCH] Fix too many warning log when restarting --- src/Service/ConnectionHandler.cpp | 2 +- src/Service/NuRaftStateMachine.cpp | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Service/ConnectionHandler.cpp b/src/Service/ConnectionHandler.cpp index c0b1f1e80d..d7f1c7eda9 100644 --- a/src/Service/ConnectionHandler.cpp +++ b/src/Service/ConnectionHandler.cpp @@ -705,7 +705,7 @@ void ConnectionHandler::updateStats(const Coordination::ZooKeeperResponsePtr & r if (unlikely(elapsed > 10000)) LOG_WARNING( log, - "The processing time for request #{}#{}#{} is {}ms, which is a little long, please take care.", + "Slow request detected #{}#{}#{}, time costs {}ms, please take care.", toHexString(session_id.load()), response->xid, Coordination::toString(response->getOpNum()), diff --git a/src/Service/NuRaftStateMachine.cpp b/src/Service/NuRaftStateMachine.cpp index d816cf0950..54428f7de5 100644 --- a/src/Service/NuRaftStateMachine.cpp +++ b/src/Service/NuRaftStateMachine.cpp @@ -311,18 +311,6 @@ nuraft::ptr NuRaftStateMachine::commit(const ulong log_idx, nura LOG_TRACE(log, "Commit log index {} fore request {}", log_idx, request_for_session.toSimpleString()); - if (request_for_session.create_time > 0) - { - Int64 elapsed = Poco::Timestamp().epochMicroseconds() / 1000 - request_for_session.create_time; - if (unlikely(elapsed > 10000)) - LOG_WARNING( - log, - "When committing log {} for request {}, the time has passed {}ms, which is a little long, please take care.", - log_idx, - request_for_session.toSimpleString(), - elapsed); - } - if (request_processor) request_processor->commit(request_for_session); else