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 2019/02/25 21:06:50 UTC

[kudu] branch master updated (25af98e -> 6eec549)

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 25af98e  KUDU-2706: Work around the lack of thread safety in krb5_parse_name()
     new 8b251ea  KUDU-2653: suppress krb5 memory leak found on Debian 8
     new 6eec549  [tests] address flake in TestClusterWithLocation

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/tools/ksck_remote-test.cc | 84 +++++++++++++++++++++++---------------
 src/kudu/util/sanitizer_options.cc | 14 ++++++-
 2 files changed, 62 insertions(+), 36 deletions(-)


[kudu] 02/02: [tests] address flake in TestClusterWithLocation

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 6eec549f052b49bc7f53673c67d23c389cc24314
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Feb 22 21:04:11 2019 -0800

    [tests] address flake in TestClusterWithLocation
    
    In case of TSAN builds and running the test at inferior machines
    with lot of concurrent activity, the masters and tablet servers run
    re-elections time to time.  Until KUDU-2704 is addressed, ksck treats
    the state of a tablet captured during its Raft election process as
    problematic.  Also, other related calls might timeout because of the
    slowness while simply establishing a connection.
    
    To avoid flakiness of this test because of that natural lifecycle
    events of Raft cluster, a few related calls are wrapped into
    ASSERT_EVENTUALLY() macro.
    
    In addition, introduced using strings::Substitute for better
    readability (non-functional update).
    
    Change-Id: If74b9ade156a5007368112a213a1db4cba58cffe
    Reviewed-on: http://gerrit.cloudera.org:8080/12564
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 src/kudu/tools/ksck_remote-test.cc | 84 +++++++++++++++++++++++---------------
 1 file changed, 50 insertions(+), 34 deletions(-)

diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index 1436155..7b7e2e3 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -71,21 +71,22 @@ DEFINE_int32(experimental_flag_for_ksck_test, 0,
              "unusual flag detection features");
 TAG_FLAG(experimental_flag_for_ksck_test, experimental);
 
-namespace kudu {
-namespace tools {
-
-using client::KuduColumnSchema;
-using client::KuduInsert;
-using client::KuduSchemaBuilder;
-using client::KuduSession;
-using client::KuduTable;
-using client::KuduTableCreator;
-using client::sp::shared_ptr;
-using cluster::InternalMiniCluster;
-using cluster::InternalMiniClusterOptions;
+using kudu::client::KuduColumnSchema;
+using kudu::client::KuduInsert;
+using kudu::client::KuduSchemaBuilder;
+using kudu::client::KuduSession;
+using kudu::client::KuduTable;
+using kudu::client::KuduTableCreator;
+using kudu::client::sp::shared_ptr;
+using kudu::cluster::InternalMiniCluster;
+using kudu::cluster::InternalMiniClusterOptions;
 using std::string;
 using std::unique_ptr;
 using std::vector;
+using strings::Substitute;
+
+namespace kudu {
+namespace tools {
 
 static const char *kTableName = "ksck-test-table";
 
@@ -282,16 +283,16 @@ TEST_F(RemoteKsckTest, TestTabletServerMismatchedUUID) {
 
   string match_string = "Error from $0: Remote error: ID reported by tablet server "
                         "($1) doesn't match the expected ID: $2 (WRONG_SERVER_UUID)";
-  ASSERT_STR_CONTAINS(err_stream_.str(), strings::Substitute(match_string, address.ToString(),
-                                                             new_uuid, old_uuid));
+  ASSERT_STR_CONTAINS(err_stream_.str(), Substitute(match_string, address.ToString(),
+                                                    new_uuid, old_uuid));
   tserver::MiniTabletServer* ts = mini_cluster_->mini_tablet_server(1);
-  ASSERT_STR_CONTAINS(err_stream_.str(), strings::Substitute("$0 | $1 | HEALTHY           | <none>",
-                                                             ts->uuid(),
-                                                             ts->bound_rpc_addr().ToString()));
+  ASSERT_STR_CONTAINS(err_stream_.str(), Substitute("$0 | $1 | HEALTHY           | <none>",
+                                                    ts->uuid(),
+                                                    ts->bound_rpc_addr().ToString()));
   ts = mini_cluster_->mini_tablet_server(2);
-  ASSERT_STR_CONTAINS(err_stream_.str(), strings::Substitute("$0 | $1 | HEALTHY           | <none>",
-                                                             ts->uuid(),
-                                                             ts->bound_rpc_addr().ToString()));
+  ASSERT_STR_CONTAINS(err_stream_.str(), Substitute("$0 | $1 | HEALTHY           | <none>",
+                                                    ts->uuid(),
+                                                    ts->bound_rpc_addr().ToString()));
 }
 
 TEST_F(RemoteKsckTest, TestTableConsistency) {
@@ -515,36 +516,51 @@ TEST_F(RemoteKsckTest, TestClusterWithLocation) {
   const string location_cmd_path = JoinPathSegments(GetTestExecutableDirectory(),
                                                    "testdata/first_argument.sh");
   const string location = "/foo";
-  FLAGS_location_mapping_cmd = strings::Substitute("$0 $1", location_cmd_path, location);
+  FLAGS_location_mapping_cmd = Substitute("$0 $1", location_cmd_path, location);
 
   ASSERT_OK(mini_cluster_->AddTabletServer());
   ASSERT_EQ(4, mini_cluster_->num_tablet_servers());
 
   ASSERT_OK(ksck_->CheckMasterHealth());
   ASSERT_OK(ksck_->CheckMasterUnusualFlags());
-  ASSERT_OK(ksck_->CheckMasterConsensus());
-  ASSERT_OK(ksck_->CheckClusterRunning());
-  ASSERT_OK(ksck_->FetchTableAndTabletInfo());
-  ASSERT_OK(ksck_->FetchInfoFromTabletServers());
+  // In case of TSAN builds and running the test at inferior machines
+  // with lot of concurrent activity, the masters and tablet servers run Raft
+  // re-elections from time to time. Also, establishing and negotiation
+  // a connection takes much longer. To avoid flakiness of this test scenario,
+  // few calls below are wrapped into ASSERT_EVENTUALLY().
+  //
+  // TODO(KUDU-2704): remove ASSERT_EVENTUALLY around CheckMasterConsensus
+  //                  when KUDU-2704 is addressed.
+  ASSERT_EVENTUALLY([&]() {
+    ASSERT_OK(ksck_->CheckMasterConsensus());
+  });
+  ASSERT_EVENTUALLY([&]() {
+    ASSERT_OK(ksck_->CheckClusterRunning());
+  });
+  ASSERT_EVENTUALLY([&]() {
+    ASSERT_OK(ksck_->FetchTableAndTabletInfo());
+  });
+  ASSERT_EVENTUALLY([&]() {
+    ASSERT_OK(ksck_->FetchInfoFromTabletServers());
+  });
 
   ASSERT_OK(ksck_->PrintResults());
-  string err_string = err_stream_.str();
+  const string& err_string = err_stream_.str();
 
   // The existing tablet servers should have location '<none>' displayed.
   for (int i = 0; i < 3; i++) {
     auto *ts = mini_cluster_->mini_tablet_server(i);
-    ASSERT_STR_CONTAINS(err_string, strings::Substitute("$0 | $1 | HEALTHY | <none>",
-                                                               ts->uuid(),
-                                                               ts->bound_rpc_addr().ToString()));
+    ASSERT_STR_CONTAINS(err_string, Substitute("$0 | $1 | HEALTHY | <none>",
+                                               ts->uuid(),
+                                               ts->bound_rpc_addr().ToString()));
   }
 
   // The newly added tablet server should have the assigned location displayed.
   auto *ts = mini_cluster_->mini_tablet_server(3);
-  ASSERT_STR_CONTAINS(err_string, strings::Substitute("$0 | $1 | HEALTHY | $2",
-                                                             ts->uuid(),
-                                                             ts->bound_rpc_addr().ToString(),
-                                                             location));
-
+  ASSERT_STR_CONTAINS(err_string, Substitute("$0 | $1 | HEALTHY | $2",
+                                             ts->uuid(),
+                                             ts->bound_rpc_addr().ToString(),
+                                             location));
   ASSERT_STR_CONTAINS(err_string,
     "Tablet Server Location Summary\n"
     " Location |  Count\n"


[kudu] 01/02: KUDU-2653: suppress krb5 memory leak found on Debian 8

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 8b251ea3e31e2c3fd3a4e8d7b2094ddb21acc814
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Fri Feb 22 10:34:03 2019 -0800

    KUDU-2653: suppress krb5 memory leak found on Debian 8
    
    This memory leak is triggered on SASL initialization, making it appear in a
    majority of tests (pretty much any test that uses a Messenger).
    
    Change-Id: Ib5af5b2957897aa7f0fc873ab6374591664375fc
    Reviewed-on: http://gerrit.cloudera.org:8080/12558
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 src/kudu/util/sanitizer_options.cc | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/kudu/util/sanitizer_options.cc b/src/kudu/util/sanitizer_options.cc
index bb0378c..0caff30 100644
--- a/src/kudu/util/sanitizer_options.cc
+++ b/src/kudu/util/sanitizer_options.cc
@@ -16,7 +16,7 @@
 // under the License.
 //
 
-#include "kudu/gutil/macros.h"
+#include "kudu/gutil/macros.h" // IWYU pragma: keep
 
 // Functions returning default options are declared weak in the runtime
 // libraries. To make the linker pick the strong replacements for those
@@ -185,7 +185,17 @@ SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() {
 
   // False positive from krb5 < 1.12
   // Fixed by upstream commit 379d39c17b8930718e98185a5b32a0f7f3e3b4b6
-  "leak:krb5_authdata_import_attributes\n";
+  "leak:krb5_authdata_import_attributes\n"
+
+  // KUDU-2653: Memory leak in libgssapi_krb5 [1]. Exists in certain patched
+  // versions of krb5-1.12 (such as krb5 in Debian 8).
+  //
+  // Unfortunately there's no narrower match without resorting to
+  // fast_unwind_on_malloc=0; the best alternative is to match on glob, but that
+  // seems like overkill too.
+  //
+  // 1. http://krbdev.mit.edu/rt/Ticket/Display.html?id=7981
+  "leak:libgssapi_krb5.so.2\n";
 }
 #endif  // LEAK_SANITIZER