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

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


The following commit(s) were added to refs/heads/master by this push:
     new 442da860278 HIVE-28670: Show failed status in all the latest 
replication history event (#5579)
442da860278 is described below

commit 442da8602786c3bec54e9cd4318e7a3c4c11d9a2
Author: harshal-16 <[email protected]>
AuthorDate: Sat Jan 25 09:02:07 2025 +0530

    HIVE-28670: Show failed status in all the latest replication history event 
(#5579)
    
        - Once Dump/Load is failed with FAILED_ADMIN then following dumps/loads 
should also be flagged as same instead of SKIPPED
---
 .../org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java   | 6 +++---
 ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java   | 2 +-
 .../apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
index 068119f11bb..25ed854772a 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
@@ -4685,12 +4685,12 @@ public void testReplicationMetricForFailedIteration() 
throws Throwable {
       verifyFail("REPL DUMP " + primaryDbName, driver);
 
       metric = collector.getMetrics().getLast();
-      assertEquals(metric.getProgress().getStatus(), Status.SKIPPED);
+      assertEquals(metric.getProgress().getStatus(), Status.FAILED_ADMIN);
       assertEquals(metric.getProgress().getStages().get(0).getErrorLogPath(), 
nonRecoverableFile.toString());
 
       verifyFail("REPL DUMP " + primaryDbName, driver);
       metric = collector.getMetrics().getLast();
-      assertEquals(metric.getProgress().getStatus(), Status.SKIPPED);
+      assertEquals(metric.getProgress().getStatus(), Status.FAILED_ADMIN);
       assertEquals(metric.getProgress().getStages().get(0).getErrorLogPath(), 
nonRecoverableFile.toString());
 
       fs.delete(nonRecoverableFile, true);
@@ -4713,7 +4713,7 @@ public void testReplicationMetricForFailedIteration() 
throws Throwable {
       verifyFail("REPL LOAD " + primaryDbName + " INTO " + replicaDbName, 
driverMirror);
 
       metric = collector.getMetrics().getLast();
-      assertEquals(metric.getProgress().getStatus(), Status.SKIPPED);
+      assertEquals(metric.getProgress().getStatus(), Status.FAILED_ADMIN);
       assertEquals(metric.getProgress().getStages().get(0).getErrorLogPath(), 
nonRecoverableFile.toString());
     } finally {
       isMetricsEnabledForTests(false);
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
index 4100bbccab5..3f9a1afb3a1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
@@ -200,7 +200,7 @@ public int execute() {
         if (ReplUtils.failedWithNonRecoverableError(latestDumpPath, conf)) {
           LOG.error("Previous dump failed with non recoverable error. Needs 
manual intervention. ");
           Path nonRecoverableFile = new Path(latestDumpPath, 
NON_RECOVERABLE_MARKER.toString());
-          ReplUtils.reportStatusInReplicationMetrics(getName(), 
Status.SKIPPED, nonRecoverableFile.toString(), conf,  work.dbNameOrPattern, 
null);
+          ReplUtils.reportStatusInReplicationMetrics(getName(), 
Status.FAILED_ADMIN, nonRecoverableFile.toString(), conf,  
work.dbNameOrPattern, null);
           setException(new 
SemanticException(ErrorMsg.REPL_FAILED_WITH_NON_RECOVERABLE_ERROR.format()));
           return 
ErrorMsg.REPL_FAILED_WITH_NON_RECOVERABLE_ERROR.getErrorCode();
         }
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
index 6a91e7b4e3d..a43dc67fc83 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
@@ -343,7 +343,7 @@ private void analyzeReplLoad(ASTNode ast) throws 
SemanticException {
               .getEncodedDumpRootPath(conf, 
sourceDbNameOrPattern.toLowerCase()), conf);
       if (ReplUtils.failedWithNonRecoverableError(latestDumpPath, conf)) {
         Path nonRecoverableFile = new Path(latestDumpPath, 
ReplAck.NON_RECOVERABLE_MARKER.toString());
-        ReplUtils.reportStatusInReplicationMetrics("REPL_LOAD", Status.SKIPPED,
+        ReplUtils.reportStatusInReplicationMetrics("REPL_LOAD", 
Status.FAILED_ADMIN,
                 nonRecoverableFile.toString(), conf,  sourceDbNameOrPattern, 
null);
         throw new 
Exception(ErrorMsg.REPL_FAILED_WITH_NON_RECOVERABLE_ERROR.getMsg());
       }

Reply via email to