You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/07/16 15:26:44 UTC

[impala] 06/06: IMPALA-8758: Improve error message when no executors are online

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

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 2dbd7eec81485293f79bcddd5b40546c7a0471c2
Author: Lars Volker <lv...@cloudera.com>
AuthorDate: Mon Jul 15 13:31:23 2019 -0700

    IMPALA-8758: Improve error message when no executors are online
    
    Prior to this change a dedicated coordinator would not create the
    default executor group when registering its own backend descriptor in
    the cluster membership. This caused a misleading error message during
    scheduling when the default executor group could not be found.
    
    To improve this, we now always create the default executor group and
    return an improved error message if it is empty.
    
    This change adds a test that validates that a query against a cluster
    without executors returns the expected error.
    
    Change-Id: Ia4428ef833363f52b14dfff253569212427a8e2f
    Reviewed-on: http://gerrit.cloudera.org:8080/13866
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/scheduling/cluster-membership-mgr.cc | 4 ++++
 be/src/scheduling/scheduler.cc              | 5 +++++
 bin/start-impala-cluster.py                 | 5 -----
 tests/custom_cluster/test_coordinators.py   | 6 ++++++
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/be/src/scheduling/cluster-membership-mgr.cc b/be/src/scheduling/cluster-membership-mgr.cc
index ca8f20d..09a3678 100644
--- a/be/src/scheduling/cluster-membership-mgr.cc
+++ b/be/src/scheduling/cluster-membership-mgr.cc
@@ -255,6 +255,10 @@ void ClusterMembershipMgr::UpdateMembership(
       } else if (local_be_desc->is_executor) {
         VLOG(1) << "Adding local backend to group " << group;
         (*new_executor_groups)[group].AddExecutor(*local_be_desc);
+      } else {
+        //TODO(IMPALA-8484): Remove this when it's no longer needed
+        VLOG(1) << "Creating empty default executor group";
+        new_executor_groups->emplace(group, ExecutorGroup());
       }
     }
     AddLocalBackendToStatestore(*local_be_desc, subscriber_topic_updates);
diff --git a/be/src/scheduling/scheduler.cc b/be/src/scheduling/scheduler.cc
index bb64f0c..12871ef 100644
--- a/be/src/scheduling/scheduler.cc
+++ b/be/src/scheduling/scheduler.cc
@@ -666,7 +666,12 @@ Status Scheduler::Schedule(QuerySchedule* schedule) {
   if (it == membership_snapshot->executor_groups.end()) {
     return Status(Substitute("Unknown executor group: $0", group_name));
   }
+
   const ExecutorGroup& executor_group = it->second;
+  if (executor_group.NumExecutors() == 0) {
+    return Status(Substitute("No executors registered in group: $0", group_name));
+  }
+
   ExecutorConfig executor_config =
       {executor_group, *membership_snapshot->local_be_desc};
   RETURN_IF_ERROR(ComputeScanRangeAssignment(executor_config, schedule));
diff --git a/bin/start-impala-cluster.py b/bin/start-impala-cluster.py
index 8b95af3..df32bf1 100755
--- a/bin/start-impala-cluster.py
+++ b/bin/start-impala-cluster.py
@@ -622,11 +622,6 @@ def validate_options():
     LOG.error("Please specify a valid number of coordinators > 0")
     sys.exit(1)
 
-  if (options.use_exclusive_coordinators and
-      options.num_coordinators >= options.cluster_size):
-    LOG.error("Cannot start an Impala cluster with no executors")
-    sys.exit(1)
-
   if not os.path.isdir(options.log_dir):
     LOG.error("Log dir does not exist or is not a directory: {log_dir}".format(
         log_dir=options.log_dir))
diff --git a/tests/custom_cluster/test_coordinators.py b/tests/custom_cluster/test_coordinators.py
index 3729749..fdf3004 100644
--- a/tests/custom_cluster/test_coordinators.py
+++ b/tests/custom_cluster/test_coordinators.py
@@ -287,3 +287,9 @@ class TestCoordinators(CustomClusterTestSuite):
     finally:
       assert client is not None
       self._stop_impala_cluster()
+
+  @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(cluster_size=1, num_exclusive_coordinators=1)
+  def test_dedicated_coordinator_without_executors(self):
+    result = self.execute_query_expect_failure(self.client, "select 2")
+    assert "No executors registered in group: default" in str(result)