You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2023/01/03 19:21:58 UTC

[kudu] branch master updated: [log] Reduce prompt log printing frequency

This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 986f1a0cd [log] Reduce prompt log printing frequency
986f1a0cd is described below

commit 986f1a0cd0427e548a8bff7ccc53b626335ebc57
Author: kedeng <kd...@gmail.com>
AuthorDate: Mon Dec 19 11:42:37 2022 +0800

    [log] Reduce prompt log printing frequency
    
    I notice the UpdateStats() function prints too frequently
    for the soft-deleted tables, or the tables that compaction
    disabled manually. If we can reduce the frequency of these
    duplicate logs, it will help us find useful information in
    the log more quickly.
    
    So I added a new flag '--update_stats_log_throttling_interval_sec'
    to control the printing frequency in UpdateStats() function.
    
    Change-Id: I06ecf355c504a931b7c3d193c129c2a757bf0e03
    Reviewed-on: http://gerrit.cloudera.org:8080/19375
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <al...@apache.org>
---
 src/kudu/tablet/tablet_mm_ops.cc         | 14 ++++++++++----
 src/kudu/tablet/tablet_replica_mm_ops.cc |  8 +++++---
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/kudu/tablet/tablet_mm_ops.cc b/src/kudu/tablet/tablet_mm_ops.cc
index 7f33ef3c8..c931cb831 100644
--- a/src/kudu/tablet/tablet_mm_ops.cc
+++ b/src/kudu/tablet/tablet_mm_ops.cc
@@ -89,6 +89,12 @@ DEFINE_bool(enable_workload_score_for_perf_improvement_ops, false,
 TAG_FLAG(enable_workload_score_for_perf_improvement_ops, experimental);
 TAG_FLAG(enable_workload_score_for_perf_improvement_ops, runtime);
 
+DEFINE_int32(update_stats_log_throttling_interval_sec, 600,
+    "Log throttling interval for messages on disabled compaction emitted by UpdateStats "
+    "method.");
+TAG_FLAG(update_stats_log_throttling_interval_sec, runtime);
+TAG_FLAG(update_stats_log_throttling_interval_sec, experimental);
+
 using std::string;
 using strings::Substitute;
 
@@ -131,7 +137,7 @@ CompactRowSetsOp::CompactRowSetsOp(Tablet* tablet)
 
 void CompactRowSetsOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_rowset_compaction || DisableCompaction())) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << Substitute("Rowset compaction is disabled (check --enable_rowset_compaction "
            "and disable_compaction in extra_config for tablet:$0)", tablet_->tablet_id());
     stats->set_runnable(false);
@@ -212,7 +218,7 @@ MinorDeltaCompactionOp::MinorDeltaCompactionOp(Tablet* tablet)
 
 void MinorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_minor_delta_compaction || DisableCompaction())) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << Substitute("Minor delta compaction is disabled (check --enable_minor_delta_compaction "
            "and disable_compaction in extra_config for tablet:$0)", tablet_->tablet_id());
     stats->set_runnable(false);
@@ -296,7 +302,7 @@ MajorDeltaCompactionOp::MajorDeltaCompactionOp(Tablet* tablet)
 
 void MajorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_major_delta_compaction || DisableCompaction())) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << Substitute("Major delta compaction is disabled (check --enable_major_delta_compaction "
            "and disable_compaction in extra_config for tablet:$0)", tablet_->tablet_id());
     stats->set_runnable(false);
@@ -379,7 +385,7 @@ UndoDeltaBlockGCOp::UndoDeltaBlockGCOp(Tablet* tablet)
 
 void UndoDeltaBlockGCOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_undo_delta_block_gc)) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << "Undo delta block GC is disabled (check --enable_undo_delta_block_gc)";
     stats->set_runnable(false);
     return;
diff --git a/src/kudu/tablet/tablet_replica_mm_ops.cc b/src/kudu/tablet/tablet_replica_mm_ops.cc
index a89aa19b4..ba1a7e6be 100644
--- a/src/kudu/tablet/tablet_replica_mm_ops.cc
+++ b/src/kudu/tablet/tablet_replica_mm_ops.cc
@@ -96,6 +96,8 @@ METRIC_DEFINE_histogram(tablet, log_gc_duration,
                         kudu::MetricLevel::kInfo,
                         60000LU, 1);
 
+DECLARE_int32(update_stats_log_throttling_interval_sec);
+
 namespace kudu {
 namespace tablet {
 
@@ -158,7 +160,7 @@ int32_t TabletReplicaOpBase::priority() const {
 
 void FlushMRSOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_flush_memrowset)) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << "Memrowset flush is disabled (check --enable_flush_memrowset)";
     stats->set_runnable(false);
     return;
@@ -235,7 +237,7 @@ scoped_refptr<AtomicGauge<uint32_t> > FlushMRSOp::RunningGauge() const {
 
 void FlushDeltaMemStoresOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_flush_deltamemstores)) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << "Deltamemstore flush is disabled (check --enable_flush_deltamemstores)";
     stats->set_runnable(false);
     return;
@@ -313,7 +315,7 @@ LogGCOp::LogGCOp(TabletReplica* tablet_replica)
 
 void LogGCOp::UpdateStats(MaintenanceOpStats* stats) {
   if (PREDICT_FALSE(!FLAGS_enable_log_gc)) {
-    KLOG_EVERY_N_SECS(WARNING, 300)
+    KLOG_EVERY_N_SECS(WARNING, FLAGS_update_stats_log_throttling_interval_sec)
         << "Log GC is disabled (check --enable_log_gc)";
     stats->set_runnable(false);
     return;