Repository: kudu
Updated Branches:
  refs/heads/master b1ef84e7b -> 1069aaae2


c++ client: use entire deadline when retrying single-master DDL operations

I was perplexed when I saw a new test that uses TestWorkload timeout in
CreateTable() after only 10s when the default admin operation timeout is
30s. Turns out, it's an actual bug in the client.

Of course, if CreateTable() is retried after 10s of waiting, it'll get
either ServiceUnavailable() or AlreadyPresent() until KUDU-1537 is fixed.

Change-Id: I23e6312bc014d59da04a0653d85d8ab1612d78d1
Reviewed-on: http://gerrit.cloudera.org:8080/4435
Tested-by: Adar Dembo <a...@cloudera.com>
Reviewed-by: Jean-Daniel Cryans <jdcry...@apache.org>


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

Branch: refs/heads/master
Commit: 1069aaae2f46cdefa8586dc9373eb431182b72d3
Parents: b1ef84e
Author: Adar Dembo <a...@cloudera.com>
Authored: Thu Sep 15 18:32:11 2016 -0700
Committer: Jean-Daniel Cryans <jdcry...@apache.org>
Committed: Tue Sep 20 18:18:36 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client-internal.cc          |  2 +-
 src/kudu/integration-tests/test_workload.cc | 16 ++++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/1069aaae/src/kudu/client/client-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/client-internal.cc 
b/src/kudu/client/client-internal.cc
index 2b0b51c..c6f7a31 100644
--- a/src/kudu/client/client-internal.cc
+++ b/src/kudu/client/client-internal.cc
@@ -205,8 +205,8 @@ Status KuduClient::Data::SyncLeaderMasterRpc(
           LOG(INFO) << "Determining the new leader Master and retrying...";
           WARN_NOT_OK(SetMasterServerProxy(client, deadline),
                       "Unable to determine the new leader Master");
-          continue;
         }
+        continue;
       } else {
         // Operation deadline expired during this latest RPC.
         s = s.CloneAndPrepend(Substitute("$0 timed out after deadline expired",

http://git-wip-us.apache.org/repos/asf/kudu/blob/1069aaae/src/kudu/integration-tests/test_workload.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.cc 
b/src/kudu/integration-tests/test_workload.cc
index 94bcb7e..275804b 100644
--- a/src/kudu/integration-tests/test_workload.cc
+++ b/src/kudu/integration-tests/test_workload.cc
@@ -199,12 +199,16 @@ void TestWorkload::Setup() {
     }
 
     gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
-    CHECK_OK(table_creator->table_name(table_name_)
-             .schema(&client_schema)
-             .num_replicas(num_replicas_)
-             .set_range_partition_columns({ "key" })
-             .split_rows(splits)
-             .Create());
+    Status s = table_creator->table_name(table_name_)
+        .schema(&client_schema)
+        .num_replicas(num_replicas_)
+        .set_range_partition_columns({ "key" })
+        .split_rows(splits)
+        .Create();
+    if (!s.ok() && !s.IsAlreadyPresent() && !s.IsServiceUnavailable()) {
+      // TODO(KUDU-1537): Should be fixed with Exactly Once semantics.
+      LOG(FATAL) << s.ToString();
+    }
   } else {
     LOG(INFO) << "TestWorkload: Skipping table creation because table "
               << table_name_ << " already exists";

Reply via email to