Repository: impala
Updated Branches:
  refs/heads/master 063d2c9d5 -> b206aeb71


IMPALA-7356 (part 2 of ?): restrict number of coordinators

The immediate motivation is to allow testing admission control with
a single coordinator where distributed overadmission is not possible.

Testing:
Ran locally against a 3 node minicluster with max-coordinators unset and
set to 1 and 3. Confirmed that queries were submitted to the expected
impalads in all cases.

Change-Id: I43a6f095fc5274bf649833e0324815ebd266c0e2
Reviewed-on: http://gerrit.cloudera.org:8080/11316
Reviewed-by: Michael Brown <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


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

Branch: refs/heads/master
Commit: b206aeb71b8795bd14d1ae80b95c4e98829f8dce
Parents: 063d2c9
Author: Tim Armstrong <tarmstr...@cloudera.com>
Authored: Fri Aug 24 11:40:12 2018 -0700
Committer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Committed: Fri Aug 24 22:26:25 2018 +0000

----------------------------------------------------------------------
 tests/stress/concurrent_select.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/b206aeb7/tests/stress/concurrent_select.py
----------------------------------------------------------------------
diff --git a/tests/stress/concurrent_select.py 
b/tests/stress/concurrent_select.py
index 71fc146..743dc93 100755
--- a/tests/stress/concurrent_select.py
+++ b/tests/stress/concurrent_select.py
@@ -548,7 +548,10 @@ class StressRunner(object):
               # Assume dequeued queries are stuck waiting for cluster 
resources so there
               # is no point in starting an additional runner.
               continue
-          impalad = impala.impalads[len(self._query_runners) % 
len(impala.impalads)]
+          num_coordinators = len(impala.impalads)
+          if self.max_coordinators > 0:
+            num_coordinators = min(num_coordinators, self.max_coordinators)
+          impalad = impala.impalads[len(self._query_runners) % 
num_coordinators]
           runner = Process(target=self._start_single_runner, args=(impalad, ))
           runner.daemon = True
           self._query_runners.append(runner)
@@ -2035,6 +2038,11 @@ def main():
       "out-of-memory errors are not expected in this mode so will fail the 
stress test "
       "if encountered. The stress runner still tracks the 'admitted' memory so 
that "
       "it can try to submit more queries than there is available memory for.")
+  parser.add_argument(
+      "--max-coordinators", default=0, type=int, metavar="max coordinators",
+      help="If > 0, submit queries to at most this number of coordinators."
+      "This is useful in conjunction with --test-admission-control to test 
behaviour "
+      "with a smaller number of admission controller instances.")
   args = parser.parse_args()
   converted_args = StressArgConverter(args)
 
@@ -2213,6 +2221,7 @@ def main():
   stress_runner.leak_check_interval_mins = args.mem_leak_check_interval_mins
   stress_runner.common_query_options = converted_args.common_query_options
   stress_runner.test_admission_control = converted_args.test_admission_control
+  stress_runner.max_coordinators = converted_args.max_coordinators
   stress_runner.run_queries(
       queries, impala, args.max_queries, args.mem_overcommit_pct,
       should_print_status=not args.no_status,

Reply via email to