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

kudu git commit: test_workload: make table creation more robust

Repository: kudu
Updated Branches:
  refs/heads/master 4f41a3cb6 -> 4ee3efed5


test_workload: make table creation more robust

The table creation here already works around the lack of Exactly Once
semantics by considering certain kinds of failures to mean success. However,
these failures imply that the client didn't finish waiting for the table to
be created, so we need to do that ourselves.

Without the patch, ClientStressTest_MultiMaster.TestLeaderResolutionTimeout
failed 1/1000 times in DEBUG mode. With it, there were no failures.

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


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

Branch: refs/heads/master
Commit: 4ee3efed54aa38d110df2a0cd3c1652cdfbcb628
Parents: 4f41a3c
Author: Adar Dembo <ad...@cloudera.com>
Authored: Wed Sep 6 12:12:54 2017 -0700
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Sep 7 02:15:12 2017 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/test_workload.cc | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/4ee3efed/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 333c27a..12dae45 100644
--- a/src/kudu/integration-tests/test_workload.cc
+++ b/src/kudu/integration-tests/test_workload.cc
@@ -271,9 +271,26 @@ void TestWorkload::Setup() {
         .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();
+    if (!s.ok()) {
+      if (!s.IsAlreadyPresent() && !s.IsServiceUnavailable()) {
+        // TODO(KUDU-1537): Should be fixed with Exactly Once semantics.
+        LOG(FATAL) << s.ToString();
+      }
+
+      // If Create() failed in a non-fatal way, we still need to wait for the
+      // table to finish creating.
+      MonoTime deadline(MonoTime::Now() + client_->default_admin_operation_timeout());
+      while (true) {
+        bool still_creating;
+        CHECK_OK(client_->IsCreateTableInProgress(table_name_, &still_creating));
+        if (!still_creating) {
+          break;
+        }
+        if (MonoTime::Now() > deadline) {
+          LOG(FATAL) << "Timed out waiting for table to finish creating";
+        }
+        SleepFor(MonoDelta::FromMilliseconds(10));
+      }
     }
   } else {
     KuduSchema existing_schema;