From cc10c9aee205d596b3ab7441a7b05b1e5bc5aad3 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Wed, 7 Jul 2021 13:36:22 -0500 Subject: [PATCH] clean up add_trace_event_to_tLog_pop --- fdbclient/ServerKnobs.cpp | 4 ++-- fdbserver/OldTLogServer_6_2.actor.cpp | 3 ++- fdbserver/TLogServer.actor.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fdbclient/ServerKnobs.cpp b/fdbclient/ServerKnobs.cpp index c206b6926b..0f1c4445e3 100644 --- a/fdbclient/ServerKnobs.cpp +++ b/fdbclient/ServerKnobs.cpp @@ -102,8 +102,8 @@ void ServerKnobs::initialize(Randomize _randomize, ClientKnobs* clientKnobs, IsS init( PUSH_STATS_SLOW_AMOUNT, 2 ); init( PUSH_STATS_SLOW_RATIO, 0.5 ); init( TLOG_POP_BATCH_SIZE, 1000 ); if ( randomize && BUGGIFY ) TLOG_POP_BATCH_SIZE = 10; - init( TLOG_POPPED_VER_LAG_THRESHOLD_FOR_TLOGPOP_TRACE, 100e6 ); - init( ENABLE_DETAILED_TLOG_POP_TRACE, 1 ); + init( TLOG_POPPED_VER_LAG_THRESHOLD_FOR_TLOGPOP_TRACE, 250e6 ); + init( ENABLE_DETAILED_TLOG_POP_TRACE, true ); // disk snapshot max timeout, to be put in TLog, storage and coordinator nodes init( MAX_FORKED_PROCESS_OUTPUT, 1024 ); diff --git a/fdbserver/OldTLogServer_6_2.actor.cpp b/fdbserver/OldTLogServer_6_2.actor.cpp index 01311635e1..ef2e83b6e7 100644 --- a/fdbserver/OldTLogServer_6_2.actor.cpp +++ b/fdbserver/OldTLogServer_6_2.actor.cpp @@ -1441,7 +1441,8 @@ ACTOR Future tLogPopCore(TLogData* self, Tag inputTag, Version to, Referen } uint64_t PoppedVersionLag = logData->persistentDataDurableVersion - logData->queuePoppedVersion; - if ( SERVER_KNOBS->ENABLE_DETAILED_TLOG_POP_TRACE && //trace is open + if ( SERVER_KNOBS->ENABLE_DETAILED_TLOG_POP_TRACE && + (logData->queuePoppedVersion > 0) && //avoid generating massive events at beginning (tagData->unpoppedRecovered || PoppedVersionLag >= SERVER_KNOBS->TLOG_POPPED_VER_LAG_THRESHOLD_FOR_TLOGPOP_TRACE)) { //when recovery or long lag TraceEvent("TLogPopDetails", logData->logId) .detail("Tag", tagData->tag.toString()) diff --git a/fdbserver/TLogServer.actor.cpp b/fdbserver/TLogServer.actor.cpp index 1ca1d45b72..484fe5ee18 100644 --- a/fdbserver/TLogServer.actor.cpp +++ b/fdbserver/TLogServer.actor.cpp @@ -1167,7 +1167,8 @@ ACTOR Future tLogPopCore(TLogData* self, Tag inputTag, Version to, Referen } uint64_t PoppedVersionLag = logData->persistentDataDurableVersion - logData->queuePoppedVersion; - if ( SERVER_KNOBS->ENABLE_DETAILED_TLOG_POP_TRACE && //trace is open + if ( SERVER_KNOBS->ENABLE_DETAILED_TLOG_POP_TRACE && + (logData->queuePoppedVersion > 0) && //avoid generating massive events at beginning (tagData->unpoppedRecovered || PoppedVersionLag >= SERVER_KNOBS->TLOG_POPPED_VER_LAG_THRESHOLD_FOR_TLOGPOP_TRACE)) { //when recovery or long lag TraceEvent("TLogPopDetails", logData->logId) .detail("Tag", tagData->tag.toString())