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 2020/03/20 22:55:44 UTC

[kudu] branch master updated (664d7fe -> 407c93a)

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 664d7fe  KUDU-2780: create thread for auto-rebalancing
     new 9d2ae8b  tserver: avoid spinlock in scanners hot path
     new d3b5521  client: micro-optimize result batch cell getters by outlining cold path
     new 407c93a  [test] add securityDebug option for Java tests

The 3 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:
 java/gradle/tests.gradle      |  6 ++++++
 src/kudu/client/scan_batch.cc | 17 +++++++++++------
 src/kudu/tserver/scanners.h   |  8 +++-----
 3 files changed, 20 insertions(+), 11 deletions(-)


[kudu] 03/03: [test] add securityDebug option for Java tests

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 407c93a04bc2914524295c352afd1cfc4afb19e4
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Mar 20 14:40:53 2020 -0700

    [test] add securityDebug option for Java tests
    
    Added securityDebug option to troubleshoot Kerberos and TLS issues.
    When enabled, tests output information on TLS cipher suite selection,
    data sent during TLS connection negotiation, Kerberos credentials cache
    information, etc.  I found it useful when debugging a flakiness in
    TestSecurity.
    
    Change-Id: I0a1fbe8ec72f9bcb80dbeb23c68676dc5f0654c8
    Reviewed-on: http://gerrit.cloudera.org:8080/15515
    Reviewed-by: Grant Henke <gr...@apache.org>
    Tested-by: Alexey Serbin <as...@cloudera.com>
---
 java/gradle/tests.gradle | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/java/gradle/tests.gradle b/java/gradle/tests.gradle
index 51a3d7f..49d9217 100644
--- a/java/gradle/tests.gradle
+++ b/java/gradle/tests.gradle
@@ -67,6 +67,12 @@ tasks.withType(Test) {
   systemProperty "java.net.preferIPv4Stack", true
   systemProperty "java.security.egd", "file:/dev/urandom" // Improve RNG generation speed.
 
+  if (propertyExists("securityDebug")) {
+    systemProperty "sun.security.krb5.debug", true
+    systemProperty "sun.security.spnego.debug", true
+    systemProperty "javax.net.debug", "all"
+  }
+
   // Only use the local KuduBinDir if we are not using the kudu-binary jar.
   if (!propertyExists("useBinJar")) {
     // Set kuduBinDir to the binaries to use with the MiniKuduCluster.


[kudu] 01/03: tserver: avoid spinlock in scanners hot path

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 9d2ae8b2114f0add8e63c6ccd63ac0b9a49079d6
Author: Todd Lipcon <to...@apache.org>
AuthorDate: Mon Mar 2 23:12:37 2020 -0800

    tserver: avoid spinlock in scanners hot path
    
    This replaces a spinlock protection of the scanner "rows_returned"
    counter to just be an atomic integer instead. This saved some CPU cycles
    in the TSBS benchmark.
    
    Change-Id: If3c32e94ada847076580e20571440833a8544c57
    Reviewed-on: http://gerrit.cloudera.org:8080/15502
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 src/kudu/tserver/scanners.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/kudu/tserver/scanners.h b/src/kudu/tserver/scanners.h
index b30bcb9..5f81763 100644
--- a/src/kudu/tserver/scanners.h
+++ b/src/kudu/tserver/scanners.h
@@ -16,6 +16,7 @@
 // under the License.
 #pragma once
 
+#include <atomic>
 #include <cstddef>
 #include <cstdint>
 #include <memory>
@@ -299,13 +300,11 @@ class Scanner {
   }
 
   void add_num_rows_returned(int64_t num_rows_added) {
-    std::lock_guard<simple_spinlock> l(lock_);
     num_rows_returned_ += num_rows_added;
     DCHECK_LE(num_rows_added, num_rows_returned_);
   }
 
   int64_t num_rows_returned() const {
-    std::lock_guard<simple_spinlock> l(lock_);
     return num_rows_returned_;
   }
 
@@ -347,8 +346,7 @@ class Scanner {
   // The current call sequence ID.
   uint32_t call_seq_id_;
 
-  // Protects last_access_time_ call_seq_id_, iter_, spec_, and
-  // num_rows_returned_.
+  // Protects last_access_time_ call_seq_id_, iter_, spec_
   mutable simple_spinlock lock_;
 
   // The time the scanner was started.
@@ -383,7 +381,7 @@ class Scanner {
 
   // The number of rows that have been serialized and sent over the wire by
   // this scanner.
-  int64_t num_rows_returned_;
+  std::atomic<int64_t> num_rows_returned_;
 
   // The cumulative amounts of wall, user cpu, and system cpu time spent on
   // this scanner, in seconds.


[kudu] 02/03: client: micro-optimize result batch cell getters by outlining cold path

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 d3b55212b9fdecc1b66c5f1163e65ec654a7bb77
Author: Todd Lipcon <to...@apache.org>
AuthorDate: Fri Dec 20 15:25:52 2019 -0800

    client: micro-optimize result batch cell getters by outlining cold path
    
    This improves performance in a couple ways:
    
    - by outlining the Substitute call and Status construction, the
      templated Get<TypeTraits> function becomes much smaller. This makes it
      get inlined into the GetInt8(), GetInt32(), etc outer functions. So,
      every call into those functions is just a single call instead of two
      calls in short succession. This makes branch prediction easier.
    
    - The addition of PREDICT_FALSE means the common path is now the
      "straight line" path which means that a tight loop calling these
      functions may be able to entirely fit within the micro-op cache, etc.
      Details here are a bit black magic but it's generally considered good
      hygiene for short loops to minimize the code footprint.
    
    - The outlining of the call also means the stack frame size is a bit
      smaller. The new code path has three "push" and "pop" instructions in
      the function intro/outro whereas the old one had 6.
    
    This improved TSBS perf about 10% for one of the workloads.
    
    Change-Id: I5838576b3e18cbe8e093bf1e9ce6418ce922de63
    Reviewed-on: http://gerrit.cloudera.org:8080/15503
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    Tested-by: Todd Lipcon <to...@apache.org>
---
 src/kudu/client/scan_batch.cc | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/kudu/client/scan_batch.cc b/src/kudu/client/scan_batch.cc
index 324d01b..6f3c278 100644
--- a/src/kudu/client/scan_batch.cc
+++ b/src/kudu/client/scan_batch.cc
@@ -95,6 +95,12 @@ class RowCell {
   const int col_idx_;
 };
 
+Status BadTypeStatus(const char* provided_type_name, const ColumnSchema& col) {
+  return Status::InvalidArgument(
+      Substitute("invalid type $0 provided for column '$1' (expected $2)",
+                 provided_type_name, col.name(), col.type_info()->name()));
+}
+
 } // anonymous namespace
 
 bool KuduScanBatch::RowPtr::IsNull(int col_idx) const {
@@ -233,14 +239,13 @@ template<typename T>
 Status KuduScanBatch::RowPtr::Get(int col_idx, typename T::cpp_type* val) const {
   const ColumnSchema& col = schema_->column(col_idx);
   if (PREDICT_FALSE(col.type_info()->type() != T::type)) {
-    // TODO: at some point we could allow type coercion here.
-    return Status::InvalidArgument(
-        Substitute("invalid type $0 provided for column '$1' (expected $2)",
-                   T::name(),
-                   col.name(), col.type_info()->name()));
+    // TODO(todd): at some point we could allow type coercion here.
+    // Explicitly out-of-line the construction of this Status in order to
+    // keep the getter code footprint as small as possible.
+    return BadTypeStatus(T::name(), col);
   }
 
-  if (col.is_nullable() && IsNull(col_idx)) {
+  if (PREDICT_FALSE(col.is_nullable() && IsNull(col_idx))) {
     return Status::NotFound("column is NULL");
   }