You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/08/24 16:03:33 UTC

[impala] 01/02: IMPALA-7714: try to avoid be test crash in statestore

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

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

commit d65cb05bb8398a65d6cfb460eed4712c4b47b753
Author: Tim Armstrong <ta...@cloudera.com>
AuthorDate: Fri Aug 14 11:33:12 2020 -0700

    IMPALA-7714: try to avoid be test crash in statestore
    
    We didn't get to a clear root cause for this, so I'm going
    to try two things.
    
    First, under the theory that the problem is somehow the
    destruction of the strings, convert them to char char*
    which does not require destruction on process teardown.
    
    Second, add some logging if the map lookup fails so
    we can better understand what may have happened.
    
    Change-Id: Id4363a93addb8a808d292906cac44ebd25c16889
    Reviewed-on: http://gerrit.cloudera.org:8080/16341
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/statestore/statestore.cc | 10 +++++++---
 be/src/statestore/statestore.h  |  4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/be/src/statestore/statestore.cc b/be/src/statestore/statestore.cc
index 7df60b2..9450294 100644
--- a/be/src/statestore/statestore.cc
+++ b/be/src/statestore/statestore.cc
@@ -135,8 +135,8 @@ const Statestore::TopicEntry::Version Statestore::Subscriber::TOPIC_INITIAL_VERS
 // Updates or heartbeats that miss their deadline by this much are logged.
 const uint32_t DEADLINE_MISS_THRESHOLD_MS = 2000;
 
-const string Statestore::IMPALA_MEMBERSHIP_TOPIC("impala-membership");
-const string Statestore::IMPALA_REQUEST_QUEUE_TOPIC("impala-request-queue");
+const char* Statestore::IMPALA_MEMBERSHIP_TOPIC = "impala-membership";
+const char* Statestore::IMPALA_REQUEST_QUEUE_TOPIC = "impala-request-queue";
 
 typedef ClientConnection<StatestoreSubscriberClientWrapper> StatestoreSubscriberConn;
 
@@ -392,7 +392,11 @@ void Statestore::Subscriber::SetLastTopicVersionProcessed(const TopicId& topic_i
   // modified.
   Topics* subscribed_topics = GetTopicsMapForId(topic_id);
   Topics::iterator topic_it = subscribed_topics->find(topic_id);
-  DCHECK(topic_it != subscribed_topics->end());
+  // IMPALA-7714: log warning to aid debugging in release builds without DCHECK.
+  if (UNLIKELY(topic_it == subscribed_topics->end())) {
+    LOG(ERROR) << "Couldn't find subscribed topic " << topic_id;
+  }
+  DCHECK(topic_it != subscribed_topics->end()) << topic_id;
   topic_it->second.last_version.Store(version);
 }
 
diff --git a/be/src/statestore/statestore.h b/be/src/statestore/statestore.h
index 8b95ce7..7b6844d 100644
--- a/be/src/statestore/statestore.h
+++ b/be/src/statestore/statestore.h
@@ -173,9 +173,9 @@ class Statestore : public CacheLineAligned {
   /// interface for specifying prioritized topics, but for now we only have a small
   /// fixed set of topics.
   /// Topic tracking the set of live Impala daemon instances.
-  static const std::string IMPALA_MEMBERSHIP_TOPIC;
+  static const char* IMPALA_MEMBERSHIP_TOPIC;
   /// Topic tracking the state of admission control on all coordinators.
-  static const std::string IMPALA_REQUEST_QUEUE_TOPIC;
+  static const char* IMPALA_REQUEST_QUEUE_TOPIC;
 
   int32_t port() { return thrift_server_->port(); }