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

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

commit 9495918c6330a69116570d92e17e181ef7f4e2fe
Author: Y Ethan Guo <[email protected]>
AuthorDate: Sat Jan 28 12:03:02 2023 -0800

    [HUDI-5631] Improve defaults of early conflict detection configs (#7770)
---
 .../org/apache/hudi/client/embedded/EmbeddedTimelineService.java  | 4 +++-
 .../src/main/java/org/apache/hudi/config/HoodieWriteConfig.java   | 2 +-
 .../java/org/apache/hudi/timeline/service/TimelineService.java    | 8 ++++----
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/embedded/EmbeddedTimelineService.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/embedded/EmbeddedTimelineService.java
index e07bde915a0..6fcc9750045 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/embedded/EmbeddedTimelineService.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/embedded/EmbeddedTimelineService.java
@@ -95,7 +95,9 @@ public class EmbeddedTimelineService {
           
.earlyConflictDetectionCheckCommitConflict(writeConfig.earlyConflictDetectionCheckCommitConflict())
           
.asyncConflictDetectorInitialDelayMs(writeConfig.getAsyncConflictDetectorInitialDelayMs())
           
.asyncConflictDetectorPeriodMs(writeConfig.getAsyncConflictDetectorPeriodMs())
-          
.earlyConflictDetectionMaxAllowableHeartbeatIntervalInMs(writeConfig.getHoodieClientHeartbeatIntervalInMs());
+          .earlyConflictDetectionMaxAllowableHeartbeatIntervalInMs(
+              writeConfig.getHoodieClientHeartbeatIntervalInMs()
+                  * writeConfig.getHoodieClientHeartbeatTolerableMisses());
     }
 
     server = new TimelineService(context, hadoopConf.newCopy(), 
timelineServiceConfBuilder.build(),
diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java
index 0f7a9c1cf44..228cc60c249 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java
@@ -582,7 +582,7 @@ public class HoodieWriteConfig extends HoodieConfig {
 
   public static final ConfigProperty<Long> 
ASYNC_CONFLICT_DETECTOR_INITIAL_DELAY_MS = ConfigProperty
       .key(CONCURRENCY_PREFIX + "async.conflict.detector.initial_delay_ms")
-      .defaultValue(30000L)
+      .defaultValue(0L)
       .sinceVersion("0.13.0")
       .withDocumentation("Used for timeline-server-based markers with "
           + "`AsyncTimelineServerBasedDetectionStrategy`. "
diff --git 
a/hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/TimelineService.java
 
b/hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/TimelineService.java
index 2f21af102ac..7082a5f22cc 100644
--- 
a/hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/TimelineService.java
+++ 
b/hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/TimelineService.java
@@ -145,7 +145,7 @@ public class TimelineService {
         "Used for timeline-server-based markers with "
             + "`AsyncTimelineServerBasedDetectionStrategy`. "
             + "The time in milliseconds to delay the first execution of async 
marker-based conflict detection.")
-    public Long asyncConflictDetectorInitialDelayMs = 30000L;
+    public Long asyncConflictDetectorInitialDelayMs = 0L;
 
     @Parameter(names = {"--async-conflict-detector-period-ms"}, description =
         "Used for timeline-server-based markers with "
@@ -157,7 +157,7 @@ public class TimelineService {
         "Used for timeline-server-based markers with "
             + "`AsyncTimelineServerBasedDetectionStrategy`. "
             + "Instants whose heartbeat is greater than the current value will 
not be used in early conflict detection.")
-    public Long maxAllowableHeartbeatIntervalInMs = 60000L;
+    public Long maxAllowableHeartbeatIntervalInMs = 120000L;
 
     @Parameter(names = {"--help", "-h"})
     public Boolean help = false;
@@ -186,9 +186,9 @@ public class TimelineService {
       private String earlyConflictDetectionStrategy = 
"org.apache.hudi.timeline.service.handlers.marker.AsyncTimelineServerBasedDetectionStrategy";
       private Boolean checkCommitConflict = false;
       private Boolean earlyConflictDetectionEnable = false;
-      private Long asyncConflictDetectorInitialDelayMs = 30000L;
+      private Long asyncConflictDetectorInitialDelayMs = 0L;
       private Long asyncConflictDetectorPeriodMs = 30000L;
-      private Long maxAllowableHeartbeatIntervalInMs = 60000L;
+      private Long maxAllowableHeartbeatIntervalInMs = 120000L;
 
       public Builder() {
       }

Reply via email to