IMPALA-3496: stress test: print version info Print the version info of each impalad that's used in a stress test run, sorted by host name.
Testing done: $ tests/stress/concurrent_select.py [redacted cluster options] --tpcds-db null --max-queries 0 Cluster Impalad Version Info: host2.redacted: impalad version 2.10.0-SNAPSHOT RELEASE (build e862385281c74baa6f1a4d10d44f3411a4303abc) Built on Tue Jul 25 07:06:27 PDT 2017 host3.redacted: impalad version 2.10.0-SNAPSHOT RELEASE (build e862385281c74baa6f1a4d10d44f3411a4303abc) Built on Tue Jul 25 07:06:27 PDT 2017 host4.redacted: impalad version 2.10.0-SNAPSHOT RELEASE (build e862385281c74baa6f1a4d10d44f3411a4303abc) Built on Tue Jul 25 07:06:27 PDT 2017 host5.redacted: impalad version 2.10.0-SNAPSHOT RELEASE (build e862385281c74baa6f1a4d10d44f3411a4303abc) Built on Tue Jul 25 07:06:27 PDT 2017 host6.redacted: impalad version 2.10.0-SNAPSHOT RELEASE (build e862385281c74baa6f1a4d10d44f3411a4303abc) Built on Tue Jul 25 07:06:27 PDT 2017 2017-07-25 12:38:52,732 12793 Thread-1 INFO:cluster[691]:Finding impalad binary location ... Change-Id: Ie4b40783ddae6b1bfb2bb4e28c0e3bf97ab944c5 Reviewed-on: http://gerrit.cloudera.org:8080/7501 Reviewed-by: Michael Brown <[email protected]> Tested-by: Michael Brown <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/c5a9b43d Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/c5a9b43d Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/c5a9b43d Branch: refs/heads/master Commit: c5a9b43db4315f4728a3454f20fa1b265a0de0fc Parents: 1aa3a5c Author: Michael Brown <[email protected]> Authored: Tue Jul 25 11:01:48 2017 -0700 Committer: Michael Brown <[email protected]> Committed: Wed Jul 26 13:16:08 2017 +0000 ---------------------------------------------------------------------- tests/comparison/cluster.py | 8 ++++++++ tests/stress/concurrent_select.py | 14 ++++++++++++++ 2 files changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c5a9b43d/tests/comparison/cluster.py ---------------------------------------------------------------------- diff --git a/tests/comparison/cluster.py b/tests/comparison/cluster.py index 761bc57..1cf9516 100644 --- a/tests/comparison/cluster.py +++ b/tests/comparison/cluster.py @@ -563,6 +563,9 @@ class Impala(Service): def cancel_queries(self): self.for_each_impalad(lambda i: i.cancel_queries()) + def get_version_info(self): + return self.for_each_impalad(lambda i: i.get_version_info(), as_dict=True) + def queries_are_running(self): return any(self.for_each_impalad(lambda i: i.queries_are_running())) @@ -676,6 +679,11 @@ class Impalad(object): # TODO: Handle losing the race raise e + def get_version_info(self): + with self.cluster.impala.cursor(impalad=self) as cursor: + cursor.execute("SELECT version()") + return ''.join(cursor.fetchone()).strip() + def shell(self, cmd, timeout_secs=DEFAULT_TIMEOUT): return self.cluster.shell(cmd, self.host_name, timeout_secs=timeout_secs) http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c5a9b43d/tests/stress/concurrent_select.py ---------------------------------------------------------------------- diff --git a/tests/stress/concurrent_select.py b/tests/stress/concurrent_select.py index 2b45c9c..d77e306 100755 --- a/tests/stress/concurrent_select.py +++ b/tests/stress/concurrent_select.py @@ -1654,6 +1654,19 @@ def populate_all_queries(queries, impala, args, runtime_info_path, return result +def print_version(cluster): + """ + Print the cluster impalad version info to the console sorted by hostname. + """ + def _sorter(i1, i2): + return cmp(i1.host_name, i2.host_name) + + version_info = cluster.impala.get_version_info() + print("Cluster Impalad Version Info:") + for impalad in sorted(version_info.keys(), cmp=_sorter): + print("{0}: {1}".format(impalad.host_name, version_info[impalad])) + + def main(): from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser from random import shuffle @@ -1851,6 +1864,7 @@ def main(): impala = cluster.impala if impala.find_stopped_impalads(): impala.restart() + print_version(cluster) impala.find_and_set_path_to_running_impalad_binary() if args.cancel_current_queries and impala.queries_are_running(): impala.cancel_queries()
