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/03/31 22:28:44 UTC

[kudu] branch master updated (2a02969e5 -> e07c941aa)

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

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


    from 2a02969e5 jwt: plumb JWT into mini cluster
     new 60d5a710f [client] Improve logging in client metacache
     new e07c941aa KUDU-3437 Set default block_cache_metrics_policy to reset

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/kudu/client/meta_cache.cc     | 21 +++++++++++++++++++++
 src/kudu/master/master_options.cc |  2 +-
 src/kudu/master/mini_master.cc    |  2 ++
 3 files changed, 24 insertions(+), 1 deletion(-)


[kudu] 01/02: [client] Improve logging in client metacache

Posted by al...@apache.org.
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

commit 60d5a710f598edbffe9e6e3193b0135f904b04f3
Author: Ashwani Raina <ar...@cloudera.com>
AuthorDate: Mon Mar 27 15:09:59 2023 +0530

    [client] Improve logging in client metacache
    
    As part for impala crashing issue KUDU-3461 (caused due to PickLeader
    getting called recursively for indefinite iterations until stack
    overflow happens), some extra logs are added to aid in debugging for
    future issues that may reside in the code path mentioned above.
    
    Change-Id: I2a47f643307ef47a98b1d3481b4c03834fa239d4
    Reviewed-on: http://gerrit.cloudera.org:8080/19653
    Tested-by: Kudu Jenkins
    Reviewed-by: Yingchun Lai <la...@apache.org>
    Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
---
 src/kudu/client/meta_cache.cc | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/kudu/client/meta_cache.cc b/src/kudu/client/meta_cache.cc
index fed115d04..02cbe15df 100644
--- a/src/kudu/client/meta_cache.cc
+++ b/src/kudu/client/meta_cache.cc
@@ -279,6 +279,7 @@ Status RemoteTablet::Refresh(
 }
 
 void RemoteTablet::MarkStale() {
+  VLOG(1) << "Marking tablet stale, tablet id " << tablet_id_;
   stale_ = true;
 }
 
@@ -461,6 +462,14 @@ void MetaCacheServerPicker::PickLeader(const ServerPickedCallback& callback,
   RemoteTabletServer* leader = nullptr;
   if (!tablet_->stale()) {
     leader = tablet_->LeaderTServer();
+    if (leader) {
+      VLOG(1) << "Client copy of tablet " << tablet_->tablet_id()
+              << " is fresh, leader uuid " << leader->permanent_uuid();
+    } else {
+      VLOG(1) << "Client copy of tablet " << tablet_->tablet_id()
+              << " is fresh (no leader).";
+    }
+
     bool marked_as_follower = false;
     {
       std::lock_guard<simple_spinlock> lock(lock_);
@@ -501,6 +510,8 @@ void MetaCacheServerPicker::PickLeader(const ServerPickedCallback& callback,
             << "Preemptively marking tserver " << leader->ToString()
             << " as leader in the meta cache.";
         tablet_->MarkTServerAsLeader(leader);
+      } else {
+        VLOG(1) << "Tablet " << tablet_->tablet_id() << ": No valid leader.";
       }
     }
   }
@@ -518,6 +529,7 @@ void MetaCacheServerPicker::PickLeader(const ServerPickedCallback& callback,
   // shift the write to another tablet (i.e. if it's since been split).
   if (!leader) {
     if (table_) {
+      VLOG(1) << "Table " << table_->name() << ": No valid leader, lookup tablet by key.";
       meta_cache_->LookupTabletByKey(
           table_,
           tablet_->partition().begin(),
@@ -528,6 +540,7 @@ void MetaCacheServerPicker::PickLeader(const ServerPickedCallback& callback,
             this->LookUpTabletCb(callback, deadline, s);
           });
     } else {
+      VLOG(1) << "No valid table or leader: lookup tablet by ID " << tablet_->tablet_id();
       meta_cache_->LookupTabletById(
           client_,
           tablet_->tablet_id(),
@@ -1212,17 +1225,22 @@ bool MetaCache::LookupEntryByKeyFastPath(const KuduTable* table,
   const TabletMap* tablets = FindOrNull(tablets_by_table_and_key_, table->id());
   if (PREDICT_FALSE(!tablets)) {
     // No cache available for this table.
+    VLOG(1) << "No cache available for table " << table->name();
     return false;
   }
 
   const MetaCacheEntry* e = FindFloorOrNull(*tablets, partition_key);
   if (PREDICT_FALSE(!e)) {
     // No tablets with a start partition key lower than 'partition_key'.
+    VLOG(1) << "Table " << table->name()
+            << ": No tablets found with a start key lower than input key.";
     return false;
   }
 
   // Stale entries must be re-fetched.
   if (e->stale()) {
+    VLOG(1) << "Table " << table->name() << ": Stale entry for tablet "
+            << e->tablet()->tablet_id() << " found, must be re-fetched.";
     return false;
   }
 
@@ -1231,6 +1249,7 @@ bool MetaCache::LookupEntryByKeyFastPath(const KuduTable* table,
     return true;
   }
 
+  VLOG(1) << "Table " << table->name() << ": LookupEntryByKeyFastPath failed!";
   return false;
 }
 
@@ -1409,6 +1428,8 @@ void MetaCache::LookupTabletByKey(const KuduTable* table,
     return;
   }
 
+  VLOG(1) << "Fastpath lookup failed with " << fastpath_status.ToString()
+          << ". Proceed with rpc lookup, table: " << table->name();
   LookupRpc* rpc = new LookupRpc(this,
                                  callback,
                                  table,


[kudu] 02/02: KUDU-3437 Set default block_cache_metrics_policy to reset

Posted by al...@apache.org.
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

commit e07c941aa6622efb758283cb2a583d0b90deb830
Author: Ádám Bakai <ab...@cloudera.com>
AuthorDate: Mon Mar 6 17:41:52 2023 +0100

    KUDU-3437 Set default block_cache_metrics_policy to reset
    
    If the master has empty local directories and connects to an existing
    cluster, it executes Master::Init twice, which executes
    StartInstrumentation twice, which is only allowed if it's a test or the
    policy is to reset the existing CacheMetrics. According to documentation
    ExistingMetricsPolicy::kKeep should only be used during tests, so the
    default value is set to kReset which fixes the original issue.
    
    Change-Id: Idc32d7ab02201382debcbe36311579550353bf71
    Reviewed-on: http://gerrit.cloudera.org:8080/19585
    Tested-by: Kudu Jenkins
    Reviewed-by: Yuqi Du <sh...@gmail.com>
    Reviewed-by: Alexey Serbin <al...@apache.org>
---
 src/kudu/master/master_options.cc | 2 +-
 src/kudu/master/mini_master.cc    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kudu/master/master_options.cc b/src/kudu/master/master_options.cc
index f95d2f090..73644669a 100644
--- a/src/kudu/master/master_options.cc
+++ b/src/kudu/master/master_options.cc
@@ -40,7 +40,7 @@ namespace kudu {
 namespace master {
 
 MasterOptions::MasterOptions()
-    : block_cache_metrics_policy_(Cache::ExistingMetricsPolicy::kKeep) {
+    : block_cache_metrics_policy_(Cache::ExistingMetricsPolicy::kReset) {
   rpc_opts.default_port = Master::kDefaultPort;
 
   if (!FLAGS_master_addresses.empty()) {
diff --git a/src/kudu/master/mini_master.cc b/src/kudu/master/mini_master.cc
index 19c26810d..e8bb0571f 100644
--- a/src/kudu/master/mini_master.cc
+++ b/src/kudu/master/mini_master.cc
@@ -31,6 +31,7 @@
 #include "kudu/master/master_options.h"
 #include "kudu/server/rpc_server.h"
 #include "kudu/server/webserver_options.h"
+#include "kudu/util/cache.h"
 #include "kudu/util/env.h"
 #include "kudu/util/env_util.h"
 #include "kudu/util/net/net_util.h"
@@ -59,6 +60,7 @@ MiniMaster::MiniMaster(string fs_root, HostPort rpc_bind_addr, int num_data_dirs
   opts_.rpc_opts.rpc_reuseport = true;
   opts_.webserver_opts.bind_interface = web_bind_addr.host();
   opts_.webserver_opts.port = web_bind_addr.port();
+  opts_.set_block_cache_metrics_policy(Cache::ExistingMetricsPolicy::kKeep);
   if (num_data_dirs == 1) {
     opts_.fs_opts.wal_root = fs_root_;
     opts_.fs_opts.data_roots = { fs_root_ };