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 2018/06/07 00:24:15 UTC

[5/8] impala git commit: Guard S3 access check with variable

Guard S3 access check with variable

We've recently seen automated build failures where multiple inclusions
of impala-config.sh led to the S3 access check being performed multiple
times. This would trigger rate limiting on S3's side, which then caused
the jobs to fail.

This change adds a guard to only perform the check once, even when
including impala-config.sh multiple times.

To test this I included impala-config.sh multiple times on my local
shell and observed that the check was only performed once.

Change-Id: I1df16b2d037afafb7748f52b64732f680883f16c
Reviewed-on: http://gerrit.cloudera.org:8080/10607
Reviewed-by: Lars Volker <lv...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-on: http://gerrit.cloudera.org:8080/10616
Tested-by: Tim Armstrong <ta...@cloudera.com>


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

Branch: refs/heads/2.x
Commit: 1a6decd2c9f01ff80cf9ea6eff5af6544422fedf
Parents: e9ef609
Author: Lars Volker <lv...@cloudera.com>
Authored: Tue Jun 5 10:19:46 2018 -0700
Committer: Tim Armstrong <ta...@cloudera.com>
Committed: Thu Jun 7 00:23:59 2018 +0000

----------------------------------------------------------------------
 bin/impala-config.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/1a6decd2/bin/impala-config.sh
----------------------------------------------------------------------
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index 9a40417..c8c99d1 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -363,11 +363,18 @@ else
 fi
 
 if [ "${TARGET_FILESYSTEM}" = "s3" ]; then
-  if ${IMPALA_HOME}/bin/check-s3-access.sh; then
-    export DEFAULT_FS="s3a://${S3_BUCKET}"
-    export FILESYSTEM_PREFIX="${DEFAULT_FS}"
+  # We guard the S3 access check with a variable. This check hits a rate-limited endpoint
+  # on AWS and multiple inclusions of S3 can exceed the limit, causing the check to fail.
+  if [[ "${S3_ACCESS_VALIDATED}" -ne 1 ]]; then
+    if ${IMPALA_HOME}/bin/check-s3-access.sh; then
+      export S3_ACCESS_VALIDATED=1
+      export DEFAULT_FS="s3a://${S3_BUCKET}"
+      export FILESYSTEM_PREFIX="${DEFAULT_FS}"
+    else
+      return 1
+    fi
   else
-    return 1
+    echo "S3 access already validated"
   fi
 elif [ "${TARGET_FILESYSTEM}" = "adls" ]; then
   # Basic error checking