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

forwardxu pushed a commit to branch release-0.12.1
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 1ae6814e7f9665933d6c104294b9fe80aa897581
Author: XuQianJin-Stars <[email protected]>
AuthorDate: Mon Dec 12 13:58:53 2022 +0800

    fix metatable compaction requested already exists
---
 .../apache/hudi/common/table/timeline/HoodieActiveTimeline.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
 
b/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
index 414e92e58b4..a3c7ab9e27e 100644
--- 
a/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
+++ 
b/hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
@@ -597,7 +597,12 @@ public class HoodieActiveTimeline extends 
HoodieDefaultTimeline {
         if (allowRedundantTransitions) {
           FileIOUtils.createFileInPath(metaClient.getFs(), 
getInstantFileNamePath(toInstant.getFileName()), data);
         } else {
-          
metaClient.getFs().createImmutableFileInPath(getInstantFileNamePath(toInstant.getFileName()),
 data);
+          if (metaClient.getMetastoreConfig().enableMetastore()
+              && 
metaClient.getFs().exists(getInstantFileNamePath(toInstant.getFileName()))) {
+            LOG.info(getInstantFileNamePath(toInstant.getFileName()) + " is 
exists!!! No need to create.");
+          } else {
+            
metaClient.getFs().createImmutableFileInPath(getInstantFileNamePath(toInstant.getFileName()),
 data);
+          }
         }
         LOG.info("Create new file for toInstant ?" + 
getInstantFileNamePath(toInstant.getFileName()));
       }

Reply via email to