Riza Suminto has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21930 )

Change subject: IMPALA-12648: Add KILL QUERY statement
......................................................................


Patch Set 46:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/21930/45/tests/custom_cluster/test_kill_query.py
File tests/custom_cluster/test_kill_query.py:

http://gerrit.cloudera.org:8080/#/c/21930/45/tests/custom_cluster/test_kill_query.py@33
PS45, Line 33:   @pytest.mark.execute_serially
             :   def test_coordinator_unreachable(self):
             :     """
             :     The coordinator of the query to kill is unreachable.
             :
             :     It is required that each impalad in the cluster is a 
coordinator.
             :     """
             :     protocol = 'hs2'
             :     with self.create_client_for_nth_impalad(0, protocol) as 
client, \
             :         QueryToKill(
             :             self,
             :             protocol,
             :             check_on_exit=False,
             :             nth_impalad=2) as query_id_to_kill:
             :       coordinator_to_kill = self.cluster.impalads[2]
             :       coordinator_to_kill.kill()
             :       assert_kill_error(
             :           client,
             :           "KillQuery() RPC failed: Network error:",
             :           query_id=query_id_to_kill,
             :       )
             :
             :   @pytest.mark.execute_serially
             :   def test_another_coordinator_unreachable(self):
             :     """
             :     A coordinator other than the one of the query to kill is 
unreachable.
             :
             :     It is required that each impalad in the cluster is a 
coordinator.
             :     """
             :     protocol = 'hs2'
             :     with self.create_client_for_nth_impalad(0, protocol) as 
client, \
             :         QueryToKill(self, protocol, nth_impalad=2) as 
query_id_to_kill:
             :       coordinator_to_kill = self.cluster.impalads[1]  # impalad 
1 is between 0 and 2.
             :       coordinator_to_kill.kill()
             :       assert_kill_ok(client, query_id_to_kill)
> After running this test, one impalad will be unreachable. I think this will
Ack


http://gerrit.cloudera.org:8080/#/c/21930/45/tests/custom_cluster/test_kill_query.py@70
PS45, Line 70:   @cluster_config.single_coordinator
             :   def test_single_coordinator(self):
> This test is added because the previous patch set had a bug in this case (T
Ack


http://gerrit.cloudera.org:8080/#/c/21930/45/tests/custom_cluster/test_kill_query.py@97
PS45, Line 97:     Make sure KILL QUERY statement can be executed when no query 
will be admitted.
> I think test_admit_no_query() shows that KILL QUERY statements are not subj
Ack


http://gerrit.cloudera.org:8080/#/c/21930/45/tests/util/cancel_util.py
File tests/util/cancel_util.py:

http://gerrit.cloudera.org:8080/#/c/21930/45/tests/util/cancel_util.py@127
PS45, Line 127: client
> I think we should probably use the client in the parameter because this is
The client is passed as parameter here to invoke client.cancel(handle).

In fact, I think both assert_kill_ok and assert_kill_error should not use the 
given client, but create a new client to mimic how KILL query will be invoked 
by different user (admin) in real world.

All client passed down here should be either of BeeswaxConnection or 
ImpylaHS2Connection. Both has self.__host_port field. You can an accessor to 
that and create a new client of the same type from this client argument.

Basically, you can add this two abstract method in ImpalaConnection and add 
implementation of them in BeeswaxConnection and ImpylaHS2Connection accordingly.

  class ImpalaConnection(with_metaclass(abc.ABCMeta, object)):

    @abc.abstractmethod
    def get_test_protocol(self):
      """Return client protocol name that is specific to Impala test framework.
      Possible return value are either of 'beeswax', 'hs2', or 'hs2-http'."""
      pass

    @abc.abstractmethod
    def get_host_port(self):
      """Return the 'host:port' string of impala server that this object 
connecting to."""
      pass

Then, you can use create_connection from impala_connection.py to create a new 
connection.



--
To view, visit http://gerrit.cloudera.org:8080/21930
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If12d6e47b256b034ec444f17c7890aa3b40481c0
Gerrit-Change-Number: 21930
Gerrit-PatchSet: 46
Gerrit-Owner: Xuebin Su <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>
Gerrit-Reviewer: Xuebin Su <[email protected]>
Gerrit-Comment-Date: Mon, 20 Jan 2025 18:27:40 +0000
Gerrit-HasComments: Yes

Reply via email to