You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2017/05/09 20:55:20 UTC

[1/3] kudu git commit: [java-client] update protoc maven plugin

Repository: kudu
Updated Branches:
  refs/heads/master ddd898106 -> 40aa4c3c2


[java-client] update protoc maven plugin

The current protoc maven plugin is not hosted on maven central
and the hosting domain is unavailable. It also has not been
updated since 2012.

It appears like the most current and maintained fork is
here: https://github.com/xolstice/protobuf-maven-plugin

Change-Id: I43167c298e5230cd6421fd992f712513f8801b5a
Reviewed-on: http://gerrit.cloudera.org:8080/6830
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <da...@apache.org>
Reviewed-by: David Ribeiro Alves <da...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/17e24812
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/17e24812
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/17e24812

Branch: refs/heads/master
Commit: 17e24812c96d7e64bcb06b201d37b5a160672e05
Parents: ddd8981
Author: Grant Henke <gr...@gmail.com>
Authored: Tue May 9 14:08:34 2017 -0500
Committer: David Ribeiro Alves <da...@gmail.com>
Committed: Tue May 9 19:55:23 2017 +0000

----------------------------------------------------------------------
 java/kudu-client/pom.xml | 22 +++++++++++-----------
 java/pom.xml             |  8 +-------
 2 files changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/17e24812/java/kudu-client/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-client/pom.xml b/java/kudu-client/pom.xml
index 2533bfe..af3d5b3 100644
--- a/java/kudu-client/pom.xml
+++ b/java/kudu-client/pom.xml
@@ -114,12 +114,12 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>com.google.protobuf.tools</groupId>
-                <artifactId>maven-protoc-plugin</artifactId>
+                <groupId>org.xolstice.maven.plugins</groupId>
+                <artifactId>protobuf-maven-plugin</artifactId>
                 <version>${maven-protoc-plugin.version}</version>
                 <configuration>
                     <!-- Documented at:
-                         http://sergei-ivanov.github.io/maven-protoc-plugin/compile-mojo.html -->
+                         https://www.xolstice.org/protobuf-maven-plugin/usage.html -->
                     <checkStaleness>true</checkStaleness>
                     <protoSourceRoot>${project.basedir}/../../src</protoSourceRoot>
                     <excludes>
@@ -296,8 +296,8 @@
                     </pluginExecution>
                     <pluginExecution>
                       <pluginExecutionFilter>
-                        <groupId>com.google.protobuf.tools</groupId>
-                        <artifactId>maven-protoc-plugin</artifactId>
+                        <groupId>org.xolstice.maven.plugins</groupId>
+                        <artifactId>protobuf-maven-plugin</artifactId>
                         <versionRange>[${maven-protoc-plugin.version},)</versionRange>
                         <goals>
                           <goal>compile</goal>
@@ -338,8 +338,8 @@
         <build>
           <plugins>
             <plugin>
-              <groupId>com.google.protobuf.tools</groupId>
-              <artifactId>maven-protoc-plugin</artifactId>
+              <groupId>org.xolstice.maven.plugins</groupId>
+              <artifactId>protobuf-maven-plugin</artifactId>
               <version>${maven-protoc-plugin.version}</version>
               <configuration>
                 <protocExecutable>
@@ -365,8 +365,8 @@
         <build>
           <plugins>
             <plugin>
-              <groupId>com.google.protobuf.tools</groupId>
-              <artifactId>maven-protoc-plugin</artifactId>
+              <groupId>org.xolstice.maven.plugins</groupId>
+              <artifactId>protobuf-maven-plugin</artifactId>
               <version>${maven-protoc-plugin.version}</version>
               <configuration>
                 <protocExecutable>
@@ -390,8 +390,8 @@
         <build>
           <plugins>
             <plugin>
-              <groupId>com.google.protobuf.tools</groupId>
-              <artifactId>maven-protoc-plugin</artifactId>
+              <groupId>org.xolstice.maven.plugins</groupId>
+              <artifactId>protobuf-maven-plugin</artifactId>
               <version>${maven-protoc-plugin.version}</version>
               <configuration>
                 <protocExecutable>protoc</protocExecutable>

http://git-wip-us.apache.org/repos/asf/kudu/blob/17e24812/java/pom.xml
----------------------------------------------------------------------
diff --git a/java/pom.xml b/java/pom.xml
index bc0c46d..e9fb3d9 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -52,7 +52,7 @@
         <maven-assembly-plugin.version>2.6</maven-assembly-plugin.version>
         <maven-enforcer-plugin.version>1.4</maven-enforcer-plugin.version>
         <maven-failsafe-plugin.version>2.18</maven-failsafe-plugin.version>
-        <maven-protoc-plugin.version>0.1.10</maven-protoc-plugin.version>
+        <maven-protoc-plugin.version>0.5.0</maven-protoc-plugin.version>
         <maven-shade-plugin.version>2.4</maven-shade-plugin.version>
         <maven-surefire-plugin.version>2.18</maven-surefire-plugin.version>
         <schema-validator-maven-plugin.version>5.5.3</schema-validator-maven-plugin.version>
@@ -277,12 +277,6 @@
     </build>
 
     <pluginRepositories>
-        <!-- For maven-protoc-plugin -->
-        <pluginRepository>
-            <id>protoc-plugin</id>
-            <url>http://maven.davidtrott.com/repository</url>
-            <name>Protoc Plugin Repository</name>
-        </pluginRepository>
         <!-- For schema-validator-maven-plugin -->
         <pluginRepository>
             <id>schema-validator-maven-plugin</id>


[2/3] kudu git commit: cert: add check for pending SSL errors in cert-related code

Posted by to...@apache.org.
cert: add check for pending SSL errors in cert-related code

We missed these functions which use SSL libraries before. Adar saw a
test failure with a pending error from the OBJ library in an unrelated
test, so my best guess is it came from here. The scoped checker should
help us find if this is the case.

Change-Id: I94bb6b71926051d2f8a7eabaa1eceb048ea9ec30
Reviewed-on: http://gerrit.cloudera.org:8080/6814
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/b1aacd91
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/b1aacd91
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/b1aacd91

Branch: refs/heads/master
Commit: b1aacd91c26654479cfce828519098ed63be600e
Parents: 17e2481
Author: Todd Lipcon <to...@apache.org>
Authored: Fri May 5 17:34:01 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue May 9 20:47:35 2017 +0000

----------------------------------------------------------------------
 src/kudu/security/cert.cc | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b1aacd91/src/kudu/security/cert.cc
----------------------------------------------------------------------
diff --git a/src/kudu/security/cert.cc b/src/kudu/security/cert.cc
index a47c7b9..cde4e47 100644
--- a/src/kudu/security/cert.cc
+++ b/src/kudu/security/cert.cc
@@ -45,6 +45,7 @@ template<> struct SslTypeTraits<GENERAL_NAMES> {
 static const char* kKuduKerberosPrincipalOidStr = "2.25.243346677289068076843480765133256509912";
 
 string X509NameToString(X509_NAME* name) {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   CHECK(name);
   auto bio = ssl_make_unique(BIO_new(BIO_s_mem()));
   OPENSSL_CHECK_OK(X509_NAME_print_ex(bio.get(), name, 0, XN_FLAG_ONELINE));
@@ -56,6 +57,7 @@ string X509NameToString(X509_NAME* name) {
 
 int GetKuduKerberosPrincipalOidNid() {
   InitializeOpenSSL();
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
 
   int nid = OBJ_txt2nid(kKuduKerberosPrincipalOidStr);
   if (nid != NID_undef) return nid;
@@ -85,6 +87,7 @@ string Cert::IssuerName() const {
 }
 
 boost::optional<string> Cert::UserId() const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   X509_NAME* name = X509_get_subject_name(data_.get());
   char buf[1024];
   int len = X509_NAME_get_text_by_NID(name, NID_userId, buf, arraysize(buf));
@@ -93,6 +96,7 @@ boost::optional<string> Cert::UserId() const {
 }
 
 vector<string> Cert::Hostnames() const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   vector<string> result;
   auto gens = ssl_make_unique(reinterpret_cast<GENERAL_NAMES*>(X509_get_ext_d2i(
       data_.get(), NID_subject_alt_name, nullptr, nullptr)));
@@ -114,6 +118,7 @@ vector<string> Cert::Hostnames() const {
 }
 
 boost::optional<string> Cert::KuduKerberosPrincipal() const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   int idx = X509_get_ext_by_NID(data_.get(), GetKuduKerberosPrincipalOidNid(), -1);
   if (idx < 0) return boost::none;
   X509_EXTENSION* ext = X509_get_ext(data_.get(), idx);
@@ -131,12 +136,14 @@ boost::optional<string> Cert::KuduKerberosPrincipal() const {
 }
 
 Status Cert::CheckKeyMatch(const PrivateKey& key) const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   OPENSSL_RET_NOT_OK(X509_check_private_key(data_.get(), key.GetRawData()),
                      "certificate does not match private key");
   return Status::OK();
 }
 
 Status Cert::GetServerEndPointChannelBindings(string* channel_bindings) const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   // Find the signature type of the certificate. This corresponds to the digest
   // (hash) algorithm, and the public key type which signed the cert.
 
@@ -203,6 +210,7 @@ void Cert::AdoptAndAddRefRawData(X509* data) {
 }
 
 Status Cert::GetPublicKey(PublicKey* key) const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   EVP_PKEY* raw_key = X509_get_pubkey(data_.get());
   OPENSSL_RET_IF_NULL(raw_key, "unable to get certificate public key");
   key->AdoptRawData(raw_key);
@@ -231,6 +239,7 @@ CertSignRequest CertSignRequest::Clone() const {
 }
 
 Status CertSignRequest::GetPublicKey(PublicKey* key) const {
+  SCOPED_OPENSSL_NO_PENDING_ERRORS;
   EVP_PKEY* raw_key = X509_REQ_get_pubkey(data_.get());
   OPENSSL_RET_IF_NULL(raw_key, "unable to get CSR public key");
   key->AdoptRawData(raw_key);


[3/3] kudu git commit: maintenance_manager: schedule work immediately when threads are free

Posted by to...@apache.org.
maintenance_manager: schedule work immediately when threads are free

This changes the MM so that, when a worker thread becomes available, it
immediately wakes up the scheduler to schedule the next available work item.
Additionally, the scheduler will loop scheduling new items as long as there
are free worker threads, instead of only scheduling once per polling
interval.

Change-Id: I63c4b48f5f02f3a1d3a8964993e78037ce72b1da
Reviewed-on: http://gerrit.cloudera.org:8080/6815
Reviewed-by: David Ribeiro Alves <da...@gmail.com>
Tested-by: Todd Lipcon <to...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/40aa4c3c
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/40aa4c3c
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/40aa4c3c

Branch: refs/heads/master
Commit: 40aa4c3c271c9df20a17a1d353ce582ee3fda742
Parents: b1aacd9
Author: Todd Lipcon <to...@apache.org>
Authored: Fri May 5 17:03:53 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue May 9 20:47:46 2017 +0000

----------------------------------------------------------------------
 src/kudu/util/maintenance_manager.cc | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/40aa4c3c/src/kudu/util/maintenance_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/maintenance_manager.cc b/src/kudu/util/maintenance_manager.cc
index 387e79f..18ed8b8 100644
--- a/src/kudu/util/maintenance_manager.cc
+++ b/src/kudu/util/maintenance_manager.cc
@@ -210,24 +210,37 @@ void MaintenanceManager::UnregisterOp(MaintenanceOp* op) {
 }
 
 void MaintenanceManager::RunSchedulerThread() {
+  if (!FLAGS_enable_maintenance_manager) {
+    LOG(INFO) << "Maintenance manager is disabled. Stopping thread.";
+    return;
+  }
+
   MonoDelta polling_interval = MonoDelta::FromMilliseconds(polling_interval_ms_);
 
   std::unique_lock<Mutex> guard(lock_);
+
+  // Set to true if the scheduler runs and finds that there is no work to do.
+  bool prev_iter_found_no_work = false;
+
   while (true) {
-    // Loop until we are shutting down or it is time to run another op.
-    cond_.TimedWait(polling_interval);
+    // We'll keep sleeping if:
+    //    1) there are no free threads available to perform a maintenance op.
+    // or 2) we just tried to schedule an op but found nothing to run.
+    // However, if it's time to shut down, we want to do so immediately.
+    while ((running_ops_ >= num_threads_ || prev_iter_found_no_work) && !shutdown_) {
+      cond_.TimedWait(polling_interval);
+      prev_iter_found_no_work = false;
+    }
     if (shutdown_) {
       VLOG_AND_TRACE("maintenance", 1) << LogPrefix() << "Shutting down maintenance manager.";
       return;
     }
 
-    if (!FLAGS_enable_maintenance_manager) {
-      KLOG_EVERY_N_SECS(INFO, 30) << "Maintenance manager is disabled. Doing nothing";
-      return;
-    }
-
     // Find the best op.
     MaintenanceOp* op = FindBestOp();
+    // If we found no work to do, then we should sleep before trying again to schedule.
+    // Otherwise, we can go right into trying to find the next op.
+    prev_iter_found_no_work = (op == nullptr);
     if (!op) {
       VLOG_AND_TRACE("maintenance", 2) << LogPrefix()
                                        << "No maintenance operations look worth doing.";
@@ -437,6 +450,7 @@ void MaintenanceManager::LaunchOp(MaintenanceOp* op) {
   running_ops_--;
   op->running_--;
   op->cond_->Signal();
+  cond_.Signal(); // wake up scheduler
 }
 
 void MaintenanceManager::GetMaintenanceManagerStatusDump(MaintenanceManagerStatusPB* out_pb) {