You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/11 11:29:23 UTC

[GitHub] [flink] zentol commented on a change in pull request #19047: [FLINK-26583][runtime] Make the Flink cluster fail if the job ID is listed as globally-terminated and cleaned

zentol commented on a change in pull request #19047:
URL: https://github.com/apache/flink/pull/19047#discussion_r824622823



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/runner/JobDispatcherLeaderProcessFactoryFactory.java
##########
@@ -77,7 +79,15 @@ public JobDispatcherLeaderProcessFactory createFactory(
         }
 
         final JobResultStore jobResultStore = jobPersistenceComponentFactory.createJobResultStore();
-        final Collection<JobResult> recoveredDirtyJobResults = getDirtyJobResults(jobResultStore);
+
+        if (accessJobResultStore(
+                () -> jobResultStore.hasCleanJobResultEntry(jobGraph.getJobID()))) {
+            throw new FlinkRuntimeException(
+                    DuplicateJobSubmissionException.ofGloballyTerminatedAndCleaned(

Review comment:
       Why do we check this in 2 places (here and the ApplicationDispatcherBootstrap)?
   
   It seems like we keep spreading these checks around; Dispatcher#submitJob is alkso checking for duplicate jobs...
   Not sure whether this is maintainable.

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/runner/JobDispatcherLeaderProcessFactoryFactory.java
##########
@@ -77,7 +79,15 @@ public JobDispatcherLeaderProcessFactory createFactory(
         }
 
         final JobResultStore jobResultStore = jobPersistenceComponentFactory.createJobResultStore();
-        final Collection<JobResult> recoveredDirtyJobResults = getDirtyJobResults(jobResultStore);
+
+        if (accessJobResultStore(
+                () -> jobResultStore.hasCleanJobResultEntry(jobGraph.getJobID()))) {
+            throw new FlinkRuntimeException(

Review comment:
       Seems questionable to throw a RuntimeException here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org