From 18c4e9200dfebbfb6d82ae33a9eb779bd0f0587a Mon Sep 17 00:00:00 2001 From: Kiran Velumuri Date: Wed, 30 Oct 2024 14:44:46 +0530 Subject: [PATCH] HIVE-28597: Upgrade to 8.4.3 LTS version of MySQL --- .../hive/ql/externalDB/AbstractExternalDB.java | 16 +++++++++++++--- .../hive/ql/externalDB/MySQLExternalDB.java | 4 ++-- .../hive/metastore/dbinstall/rules/Mysql.java | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java index 48da33442774..0b850a32582f 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java @@ -111,6 +111,7 @@ private ProcessResults runCmdAndPrintStreams(String[] cmd, long secondsToWait) public void launchDockerContainer() throws Exception { + printDockerVersion(); runCmdAndPrintStreams(buildRmCmd(), 600); if (runCmdAndPrintStreams(buildRunCmd(), 600).rc != 0) { printDockerEvents(); @@ -134,15 +135,24 @@ public void launchDockerContainer() throws Exception { } } - protected void printDockerEvents() { + protected void printDockerVersion() { try { - runCmdAndPrintStreams(new String[] { "docker", "events", "--since", "24h", "--until", "0s" }, 3); + runCmdAndPrintStreams(new String[] { "docker", "version" }, 3); } catch (Exception e) { - LOG.warn("A problem was encountered while attempting to retrieve Docker events (the system made an analytical" + LOG.warn("A problem was encountered while attempting to retrieve Docker version (the system made an analytical" + " best effort to list the events to reveal the root cause). No further actions are necessary.", e); } } + protected void printDockerEvents() { + try { + runCmdAndPrintStreams(new String[] { "docker", "events", "--since", "24h", "--until", "0s" }, 3); + } catch (Exception e) { + LOG.warn("A problem was encountered while attempting to retrieve Docker events (the system made an analytical" + + " best effort to list the events to reveal the root cause). No further actions are necessary.", e); + } + } + public void cleanupDockerContainer() throws IOException, InterruptedException { if (runCmdAndPrintStreams(buildRmCmd(), 600).rc != 0) { throw new RuntimeException("Unable to remove docker container"); diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/MySQLExternalDB.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/MySQLExternalDB.java index 1a42f1fd274c..5bf9cd741dea 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/MySQLExternalDB.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/MySQLExternalDB.java @@ -42,7 +42,7 @@ public String getJdbcDriver() { return "com.mysql.jdbc.Driver"; } - public String getDockerImageName() { return "mysql:5.7.37"; } + public String getDockerImageName() { return "mysql:8.4.3"; } public String[] getDockerAdditionalArgs() { return new String[] {"-p", "3306:3306", @@ -53,7 +53,7 @@ public String[] getDockerAdditionalArgs() { } public boolean isContainerReady(ProcessResults pr) { - Pattern pat = Pattern.compile("ready for connections"); + Pattern pat = Pattern.compile("mysqld.*ready for connections.*port.*3306"); Matcher m = pat.matcher(pr.stderr); return m.find() && m.find(); } diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java index 7b6abc4dc339..b07b7cfa5257 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mysql.java @@ -27,7 +27,7 @@ public class Mysql extends DatabaseRule { @Override public String getDockerImageName() { - return "mysql:5.7.37"; + return "mysql:8.4.3"; } @Override @@ -67,7 +67,7 @@ public String getInitialJdbcUrl(String hostAddress) { @Override public boolean isContainerReady(ProcessResults pr) { - Pattern pat = Pattern.compile("ready for connections"); + Pattern pat = Pattern.compile("mysqld.*ready for connections.*port.*3306"); Matcher m = pat.matcher(pr.stderr); return m.find() && m.find(); }