From 9cebfcf340bcca4defaccb889fe72df6476cbe1e Mon Sep 17 00:00:00 2001 From: wu-a-ge Date: Mon, 10 Jul 2023 21:13:41 +0800 Subject: [PATCH] fix:the HdfsStorage can not delete checkpoint file #5046 (#5054) --- .../engine/checkpoint/storage/hdfs/HdfsStorage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/seatunnel-engine/seatunnel-engine-storage/checkpoint-storage-plugins/checkpoint-storage-hdfs/src/main/java/org/apache/seatunnel/engine/checkpoint/storage/hdfs/HdfsStorage.java b/seatunnel-engine/seatunnel-engine-storage/checkpoint-storage-plugins/checkpoint-storage-hdfs/src/main/java/org/apache/seatunnel/engine/checkpoint/storage/hdfs/HdfsStorage.java index 9dcc94f8058..dc819c6ad7e 100644 --- a/seatunnel-engine/seatunnel-engine-storage/checkpoint-storage-plugins/checkpoint-storage-hdfs/src/main/java/org/apache/seatunnel/engine/checkpoint/storage/hdfs/HdfsStorage.java +++ b/seatunnel-engine/seatunnel-engine-storage/checkpoint-storage-plugins/checkpoint-storage-hdfs/src/main/java/org/apache/seatunnel/engine/checkpoint/storage/hdfs/HdfsStorage.java @@ -283,7 +283,9 @@ public synchronized void deleteCheckpoint(String jobId, String pipelineId, Strin if (pipelineId.equals(getPipelineIdByFileName(fileName)) && checkpointId.equals(getCheckpointIdByFileName(fileName))) { try { - fs.delete(new Path(fileName), false); + fs.delete( + new Path(path + DEFAULT_CHECKPOINT_FILE_PATH_SPLIT + fileName), + false); } catch (Exception e) { log.error( "Failed to delete checkpoint {} for job {}, pipeline {}", @@ -311,7 +313,9 @@ public void deleteCheckpoint(String jobId, String pipelineId, List check if (pipelineId.equals(getPipelineIdByFileName(fileName)) && checkpointIdList.contains(checkpointIdByFileName)) { try { - fs.delete(new Path(fileName), false); + fs.delete( + new Path(path + DEFAULT_CHECKPOINT_FILE_PATH_SPLIT + fileName), + false); } catch (Exception e) { log.error( "Failed to delete checkpoint {} for job {}, pipeline {}",