zhuzhurk commented on a change in pull request #15229: URL: https://github.com/apache/flink/pull/15229#discussion_r742521923
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/DefaultSchedulerComponents.java ########## @@ -124,9 +126,19 @@ private static SlotSelectionStrategy selectSlotSelectionStrategy( ? LocationPreferenceSlotSelectionStrategy.createEvenlySpreadOut() : LocationPreferenceSlotSelectionStrategy.createDefault(); - return configuration.getBoolean(CheckpointingOptions.LOCAL_RECOVERY) - ? PreviousAllocationSlotSelectionStrategy.create( - locationPreferenceSlotSelectionStrategy) - : locationPreferenceSlotSelectionStrategy; + final boolean isLocalRecoveryEnabled = + configuration.getBoolean(CheckpointingOptions.LOCAL_RECOVERY); + if (isLocalRecoveryEnabled) { + if (jobType == JobType.STREAMING) { + return PreviousAllocationSlotSelectionStrategy.create( + locationPreferenceSlotSelectionStrategy); + } else { + throw new IllegalArgumentException( + "Local recovery does not support batch jobs. Please set configuration " + + "'state.backend.local-recovery' to false for batch jobs."); Review comment: I think you are right. I will change it to override the strategy to `LocationPreferenceSlotSelectionStrategy` and log a warning for it. -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org