zhangyue19921010 commented on a change in pull request #3887:
URL: https://github.com/apache/hudi/pull/3887#discussion_r767385794



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/fs/FileSystemGuardConfig.java
##########
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.fs;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * The consistency guard relevant config options.
+ */
+@ConfigClassProperty(name = "FileSystem Guard Configurations",
+        groupName = ConfigGroups.Names.WRITE_CLIENT,
+        description = "The filesystem guard related config options, to help 
deal with runtime exception like s3 list/get/put/delete performance issues.")
+public class FileSystemGuardConfig  extends HoodieConfig {
+
+  public static final ConfigProperty<String> FILESYSTEM_RETRY_ENABLE = 
ConfigProperty
+      .key("hoodie.filesystem.action.retry.enabled")
+      .defaultValue("false")
+      .sinceVersion("0.10.0")
+      .withDocumentation("Enabled to handle S3 list/get/delete etc file system 
performance issue.");
+
+  public static final ConfigProperty<Long> INITIAL_RETRY_INTERVAL_MS = 
ConfigProperty
+      .key("hoodie.filesystem.action.retry.initial_interval_ms")
+      .defaultValue(100L)
+      .sinceVersion("0.10.0")
+      .withDocumentation("Amount of time (in ms) to wait, before retry to do 
operations on storage.");
+
+  public static final ConfigProperty<Long> MAX_RETRY_INTERVAL_MS = 
ConfigProperty
+      .key("hoodie.filesystem.action.retry.max_interval_ms")
+      .defaultValue(2000L)
+      .sinceVersion("0.10.0")
+      .withDocumentation("Maximum amount of time (in ms), to wait for next 
retry.");
+
+  public static final ConfigProperty<Integer> MAX_RETRY_NUMBERS = 
ConfigProperty
+      .key("hoodie.filesystem.action.retry.max_numbers")

Review comment:
       We use `(long) Math.pow(2, retryCount) * initialIntervalTime + 
random.nextInt(100);` to calculate sleep time before each retry. And we may 
need `MAX_RETRY_INTERVAL_MS` to control the maximum duration of a single sleep 
in case sleep too long`Math.min(getWaitTimeExp(retries), maxIntervalTime)`. 
   
   Also use `MAX_RETRY_NUMBERS` to control max retry numbers to limit total 
retry time. 




-- 
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: commits-unsubscr...@hudi.apache.org

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


Reply via email to