You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2024/01/18 00:15:55 UTC

(impala) branch master updated: IMPALA-12566: Fix RpcMgrKerberizedTest on RedHat 8

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a7d733653 IMPALA-12566: Fix RpcMgrKerberizedTest on RedHat 8
a7d733653 is described below

commit a7d73365314546e916f42c97cc5805cff43f1baa
Author: Michael Smith <mi...@cloudera.com>
AuthorDate: Tue Jan 9 15:22:06 2024 -0800

    IMPALA-12566: Fix RpcMgrKerberizedTest on RedHat 8
    
    On RedHat 8, RpcMgrKerberizedTest cases fail with
    
      Jan 09 14:47:03 msmith.vpc.cloudera.com krb5kdc[609624](info): TGS_REQ
      (1 etypes {aes128-cts-hmac-sha1-96(17)}) 127.0.0.1: LOOKING_UP_SERVER:
      authtime 0, etypes {rep=UNSUPPORTED:(0)}
      impala-test/msmith.vpc.cloudera.com@KRBTEST.COM for
      impala-test/msmith@KRBTEST.COM, Server not found in Kerberos database
    
    This happens because bootstrap_system.sh adds an entry to /etc/hosts to
    resolve 127.0.0.1 to hostname and puts the short hostname first. During
    negotiation, Kudu RPC will call GetFQDN to retrieve the FQDN, which for
    our tests running on localhost returns the short hostname.
    
    Fixes RpcMgrKerberizedTest by swapping the order of entries added to
    /etc/hosts so the FQDN comes first. This is consistent with the example
    provided in https://man7.org/linux/man-pages/man5/hosts.5.html.
    
    Avoids 'hostname -f'; on RedHat it's identical to 'hostname', and on
    Ubuntu it causes this test to fail.
    
    Change-Id: I1eb24f9faec766e388d793408aedecdc92107185
    Reviewed-on: http://gerrit.cloudera.org:8080/20876
    Reviewed-by: Alexey Serbin <al...@apache.org>
    Reviewed-by: Jason Fehr <jf...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Riza Suminto <ri...@cloudera.com>
---
 bin/bootstrap_system.sh | 3 ++-
 docker/entrypoint.sh    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/bootstrap_system.sh b/bin/bootstrap_system.sh
index bf1e7a211..173a18dbf 100755
--- a/bin/bootstrap_system.sh
+++ b/bin/bootstrap_system.sh
@@ -454,7 +454,8 @@ ssh localhost whoami
 #  Traceback (most recent call last):
 #    ...
 #  ...ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))
-echo -e "\n127.0.0.1 $(hostname -s) $(hostname)" | sudo tee -a /etc/hosts
+# Prefer the FQDN first for rpc-mgr-kerberized-test as newer krb5 requires FQDN.
+echo -e "\n127.0.0.1 $(hostname) $(hostname -s)" | sudo tee -a /etc/hosts
 #
 # In Docker, one can change /etc/hosts as above but not with sed -i. The error message is
 # "sed: cannot rename /etc/sedc3gPj8: Device or resource busy". The following lines are
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 9de5b64fa..bdaad8bf8 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -164,7 +164,7 @@ function boot_container() {
   #
   # "sed -i" in place doesn't work on Docker, because /etc/hosts is a bind mount.
   sed -e /$(hostname)/d /etc/hosts > /tmp/hosts
-  echo "127.0.0.1 $(hostname -s) $(hostname)" >> /tmp/hosts
+  echo "127.0.0.1 $(hostname) $(hostname -s)" >> /tmp/hosts
   sudo cp /tmp/hosts /etc/hosts
 
   echo Hostname: $(hostname)