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/11/16 03:21:03 UTC

[kudu] branch branch-1.11.x updated (c42b889 -> 34dfee4)

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

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


    from c42b889  [docs] update info on KUDU-2990 in known issues
     new bedbfc3  thirdparty: remove memkind from LICENSE.txt
     new 34dfee4  [mini_cluster] SetDaemonFlag for test minicluster

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:
 .../apache/kudu/test/cluster/MiniKuduCluster.java  | 39 +++++++++++++
 src/kudu/tools/kudu-tool-test.cc                   | 64 ++++++++++++++++++++++
 src/kudu/tools/tool.proto                          | 10 ++++
 src/kudu/tools/tool_action_test.cc                 | 17 ++++++
 thirdparty/LICENSE.txt                             | 60 --------------------
 5 files changed, 130 insertions(+), 60 deletions(-)


[kudu] 01/02: thirdparty: remove memkind from LICENSE.txt

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bedbfc37863ccd92409d3f5e93f3c2ca735e0478
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Tue Nov 12 23:26:18 2019 -0800

    thirdparty: remove memkind from LICENSE.txt
    
    I'm getting kinda overwhelmed by the sheer number of license files we seem
    to be juggling. I guess that's how we missed this one.
    
    Change-Id: I7989fca644f573e90304af4cbf5dc2440fe37d3e
    Reviewed-on: http://gerrit.cloudera.org:8080/14703
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    (cherry picked from commit 7e1bcb63958ad3e672322a005f441e5dd3a9d087)
    Reviewed-on: http://gerrit.cloudera.org:8080/14725
---
 thirdparty/LICENSE.txt | 60 --------------------------------------------------
 1 file changed, 60 deletions(-)

diff --git a/thirdparty/LICENSE.txt b/thirdparty/LICENSE.txt
index 7c14d0f..9bdaf7d 100644
--- a/thirdparty/LICENSE.txt
+++ b/thirdparty/LICENSE.txt
@@ -512,66 +512,6 @@ Source: http://savannah.nongnu.org/projects/libunwind/
   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 --------------------------------------------------------------------------------
-thirdparty/src/memkind-*/: BSD 3-clause license
-libraries: libmemkind
-Source: https://github.com/memkind/memkind
-
-  Unless otherwise specified, files in the memkind source distribution are
-  subject to the following license:
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice,
-        this list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright
-        notice, this list of conditions and the following disclaimer in the
-        documentation and/or other materials provided with the distribution.
-      * Neither the name of Intel Corporation nor the names of its contributors
-        may be used to endorse or promote products derived from this software
-        without specific prior written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-memkind bundles jemalloc which is licensed under the BSD 2-clause license:
-
-  Unless otherwise specified, files in the jemalloc source distribution are
-  subject to the following license:
-
-  Copyright (C) 2002-2017 Jason Evans <ja...@canonware.com>.
-  All rights reserved.
-  Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-  Copyright (C) 2009-2017 Facebook, Inc.  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are met:
-  1. Redistributions of source code must retain the above copyright notice(s),
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice(s),
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
-  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
-  EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
-  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---------------------------------------------------------------------------------
 thirdparty/src/boost_*/: Boost Software License
 Source: http://www.boost.org/
 


[kudu] 02/02: [mini_cluster] SetDaemonFlag for test minicluster

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 34dfee4de0cbf5126bd0e2b7f431008cd519c046
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Thu Nov 14 19:45:30 2019 -0800

    [mini_cluster] SetDaemonFlag for test minicluster
    
    Added control knobs to call SetFlag() RPC on masters and tablet servers
    via mini_cluster test interface.  Also, added a test to cover the
    new functionality.
    
    Change-Id: Ie05aa87bba1b709cbbab953b6b220cae0fc958bb
    Reviewed-on: http://gerrit.cloudera.org:8080/14712
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    (cherry picked from commit 9b1ff304ca5f9f2e1ea08646c7307fcbe0486015)
    Reviewed-on: http://gerrit.cloudera.org:8080/14726
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 .../apache/kudu/test/cluster/MiniKuduCluster.java  | 39 +++++++++++++
 src/kudu/tools/kudu-tool-test.cc                   | 64 ++++++++++++++++++++++
 src/kudu/tools/tool.proto                          | 10 ++++
 src/kudu/tools/tool_action_test.cc                 | 17 ++++++
 4 files changed, 130 insertions(+)

diff --git a/java/kudu-test-utils/src/main/java/org/apache/kudu/test/cluster/MiniKuduCluster.java b/java/kudu-test-utils/src/main/java/org/apache/kudu/test/cluster/MiniKuduCluster.java
index 2d40df6..ff5a15a 100644
--- a/java/kudu-test-utils/src/main/java/org/apache/kudu/test/cluster/MiniKuduCluster.java
+++ b/java/kudu-test-utils/src/main/java/org/apache/kudu/test/cluster/MiniKuduCluster.java
@@ -52,6 +52,7 @@ import org.apache.kudu.tools.Tool.GetMastersRequestPB;
 import org.apache.kudu.tools.Tool.GetTServersRequestPB;
 import org.apache.kudu.tools.Tool.KdestroyRequestPB;
 import org.apache.kudu.tools.Tool.KinitRequestPB;
+import org.apache.kudu.tools.Tool.SetDaemonFlagRequestPB;
 import org.apache.kudu.tools.Tool.StartClusterRequestPB;
 import org.apache.kudu.tools.Tool.StartDaemonRequestPB;
 import org.apache.kudu.tools.Tool.StopDaemonRequestPB;
@@ -421,6 +422,44 @@ public class MiniKuduCluster implements AutoCloseable {
   }
 
   /**
+   * Set flag for the specified master.
+   *
+   * @param hp unique host and port identifying the target master
+   * @throws IOException if something went wrong in transit
+   */
+  public void setMasterFlag(HostAndPort hp, String flag, String value)
+      throws IOException {
+    DaemonInfo d = getMasterServer(hp);
+    LOG.info("Setting flag for master at {}", hp);
+    sendRequestToCluster(ControlShellRequestPB.newBuilder()
+        .setSetDaemonFlag(SetDaemonFlagRequestPB.newBuilder()
+            .setId(d.id)
+            .setFlag(flag)
+            .setValue(value)
+            .build())
+        .build());
+  }
+
+  /**
+   * Set flag for the specified tablet server.
+   *
+   * @param hp unique host and port identifying the target tablet server
+   * @throws IOException if something went wrong in transit
+   */
+  public void setTServerFlag(HostAndPort hp, String flag, String value)
+      throws IOException {
+    DaemonInfo d = getTabletServer(hp);
+    LOG.info("Setting flag for tserver at {}", hp);
+    sendRequestToCluster(ControlShellRequestPB.newBuilder()
+        .setSetDaemonFlag(SetDaemonFlagRequestPB.newBuilder()
+            .setId(d.id)
+            .setFlag(flag)
+            .setValue(value)
+            .build())
+        .build());
+  }
+
+  /**
    * Removes all credentials for all principals from the Kerberos credential cache.
    */
   public void kdestroy() throws IOException {
diff --git a/src/kudu/tools/kudu-tool-test.cc b/src/kudu/tools/kudu-tool-test.cc
index f122e78..4b3fcca 100644
--- a/src/kudu/tools/kudu-tool-test.cc
+++ b/src/kudu/tools/kudu-tool-test.cc
@@ -4730,6 +4730,70 @@ TEST_P(ControlShellToolTest, TestControlShell) {
     ASSERT_OK(SendReceive(req, &resp));
   }
 
+  // Set flag.
+  {
+    ControlShellRequestPB req;
+    ControlShellResponsePB resp;
+    auto* r = req.mutable_set_daemon_flag();
+    *r->mutable_id() = tservers[0].id();
+    r->set_flag("rpc_negotiation_timeout_ms");
+    r->set_value("5000");
+    ASSERT_OK(SendReceive(req, &resp));
+  }
+
+  // Try to set a non-existent flag: this should fail.
+  {
+    ControlShellRequestPB req;
+    ControlShellResponsePB resp;
+    auto* r = req.mutable_set_daemon_flag();
+    *r->mutable_id() = masters[0].id();
+    r->set_flag("__foo_bar_flag__");
+    r->set_value("__value__");
+    ASSERT_OK(proto_->SendMessage(req));
+    ASSERT_OK(proto_->ReceiveMessage(&resp));
+    ASSERT_TRUE(resp.has_error());
+    auto s = StatusFromPB(resp.error());
+    ASSERT_TRUE(s.IsRemoteError()) << s.ToString();
+    ASSERT_STR_CONTAINS(s.ToString(),
+                        "failed to set flag: result: NO_SUCH_FLAG");
+  }
+
+  // Try to set a flag on a non-existent daemon: this should fail.
+  {
+    ControlShellRequestPB req;
+    ControlShellResponsePB resp;
+    auto* r = req.mutable_set_daemon_flag();
+    r->mutable_id()->set_index(1000);
+    r->mutable_id()->set_type(MASTER);
+    r->set_flag("flag");
+    r->set_value("value");
+    ASSERT_OK(proto_->SendMessage(req));
+    ASSERT_OK(proto_->ReceiveMessage(&resp));
+    ASSERT_TRUE(resp.has_error());
+    auto s = StatusFromPB(resp.error());
+    ASSERT_TRUE(s.IsNotFound()) << s.ToString();
+    ASSERT_STR_CONTAINS(s.ToString(), "no master with index 1000");
+  }
+
+  // Try to set a flag on a KDC: this should fail since mini-KDC doesn't support
+  // SetFlag() call.
+  {
+    ControlShellRequestPB req;
+    ControlShellResponsePB resp;
+    auto* r = req.mutable_set_daemon_flag();
+    r->mutable_id()->set_index(0);
+    r->mutable_id()->set_type(KDC);
+    r->set_flag("flag");
+    r->set_value("value");
+    ASSERT_OK(proto_->SendMessage(req));
+    ASSERT_OK(proto_->ReceiveMessage(&resp));
+    ASSERT_TRUE(resp.has_error());
+    auto s = StatusFromPB(resp.error());
+    ASSERT_TRUE(s.IsInvalidArgument()) << s.ToString();
+    ASSERT_STR_CONTAINS(s.ToString(),
+                        "mini-KDC doesn't support SetFlag()");
+  }
+
   if (enable_kerberos()) {
     // Restart the KDC.
     {
diff --git a/src/kudu/tools/tool.proto b/src/kudu/tools/tool.proto
index 570ef45..f84f683 100644
--- a/src/kudu/tools/tool.proto
+++ b/src/kudu/tools/tool.proto
@@ -159,6 +159,15 @@ message KinitRequestPB {
   optional string username = 1 [ default = "test-admin" ];
 };
 
+// Call SetFlag() on the specific daemon.
+message SetDaemonFlagRequestPB {
+  // The identifier for the daemon to sent the request to.
+  optional DaemonIdentifierPB id = 1;
+  // The name of the flag to set.
+  optional string flag = 2;
+  // Value to set.
+  optional string value = 3;
+}
 
 // Sent by the control shell in response to a control shell command request.
 message ControlShellResponsePB {
@@ -194,6 +203,7 @@ message ControlShellRequestPB {
     GetKDCEnvVarsRequestPB get_kdc_env_vars = 9;
     KdestroyRequestPB kdestroy = 10;
     KinitRequestPB kinit = 11;
+    SetDaemonFlagRequestPB set_daemon_flag = 12;
   }
 }
 
diff --git a/src/kudu/tools/tool_action_test.cc b/src/kudu/tools/tool_action_test.cc
index af65dad..da0de8d 100644
--- a/src/kudu/tools/tool_action_test.cc
+++ b/src/kudu/tools/tool_action_test.cc
@@ -286,6 +286,23 @@ Status ProcessRequest(const ControlShellRequestPB& req,
       RETURN_NOT_OK((*cluster)->kdc()->Kinit(req.kinit().username()));
       break;
     }
+    case ControlShellRequestPB::kSetDaemonFlag:
+    {
+      const auto& r = req.set_daemon_flag();
+      if (!r.has_id()) {
+        RETURN_NOT_OK(Status::InvalidArgument("missing process id"));
+      }
+      const auto& id = r.id();
+      if (id.type() == DaemonType::KDC) {
+        return Status::InvalidArgument("mini-KDC doesn't support SetFlag()");
+      }
+      ExternalDaemon* daemon;
+      MiniKdc* kdc;
+      RETURN_NOT_OK(FindDaemon(*cluster, id, &daemon, &kdc));
+      DCHECK(daemon);
+      RETURN_NOT_OK((*cluster)->SetFlag(daemon, r.flag(), r.value()));
+      break;
+    }
     default:
       RETURN_NOT_OK(Status::InvalidArgument("unknown cluster control request"));
   }