You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "dxichen (via GitHub)" <gi...@apache.org> on 2023/02/01 02:00:00 UTC

[GitHub] [samza] dxichen commented on a diff in pull request #1650: Make blob store related retry tunables configurable

dxichen commented on code in PR #1650:
URL: https://github.com/apache/samza/pull/1650#discussion_r1092650718


##########
samza-core/src/main/java/org/apache/samza/config/BlobStoreConfig.java:
##########
@@ -19,23 +19,75 @@
 
 package org.apache.samza.config;
 
+import java.time.temporal.ChronoUnit;
+import org.apache.samza.util.RetryPolicyConfig;
+
+
 /**
  * Config related helper methods for BlobStore.
  */
 public class BlobStoreConfig extends MapConfig {
 
-  public static final String BLOB_STORE_MANAGER_FACTORY = "blob.store.manager.factory";
-  public static final String BLOB_STORE_ADMIN_FACTORY = "blob.store.admin.factory";
+  private static final String PREFIX = "blob.store.";
+  public static final String BLOB_STORE_MANAGER_FACTORY = PREFIX + "manager.factory";
+  public static final String BLOB_STORE_ADMIN_FACTORY = PREFIX + "admin.factory";
+  // Configs related to retry policy of blob stores
+  private static final String RETRY_POLICY_PREFIX = PREFIX + "retry.policy.";
+  public static final String RETRY_POLICY_MAX_RETRIES = RETRY_POLICY_PREFIX + "max.retries";
+  // -1 for RetryPolicy means unlimited retries. Retry is limited by max retry duration, rather than count of retries.
+  public static final int DEFAULT_RETRY_POLICY_MAX_RETRIES = -1;
+  public static final String RETRY_POLICY_MAX_RETRY_DURATION_MILLIS = RETRY_POLICY_PREFIX + "max.retry.duration.millis";
+  public static final long DEFAULT_RETRY_POLICY_MAX_RETRY_DURATION_MILLIS = 15 * 60 * 1000; // 15 mins
+  public static final String RETRY_POLICY_BACKOFF_DELAY_MILLIS = RETRY_POLICY_PREFIX + "backoff.delay.millis";
+  public static final long DEFAULT_RETRY_POLICY_BACKOFF_DELAY_MILLIS = 100;
+  public static final String RETRY_POLICY_BACKOFF_MAX_DELAY_MILLIS = RETRY_POLICY_PREFIX + "backoff.max.delay.millis";
+  public static final long DEFAULT_RETRY_POLICY_BACKOFF_MAX_DELAY_MILLIS = 312500;

Review Comment:
   Out of curiosity why did we choose this number? Maybe some documentation on how we arrived at this



##########
samza-core/src/main/java/org/apache/samza/config/BlobStoreConfig.java:
##########
@@ -19,23 +19,55 @@
 
 package org.apache.samza.config;
 
+import java.time.temporal.ChronoUnit;
+import org.apache.samza.util.RetryPolicyConfig;
+
+
 /**
  * Config related helper methods for BlobStore.
  */
 public class BlobStoreConfig extends MapConfig {
 
-  public static final String BLOB_STORE_MANAGER_FACTORY = "blob.store.manager.factory";
-  public static final String BLOB_STORE_ADMIN_FACTORY = "blob.store.admin.factory";
+  private static final String PREFIX = "blob.store.";
+  public static final String BLOB_STORE_MANAGER_FACTORY = PREFIX + "manager.factory";
+  public static final String BLOB_STORE_ADMIN_FACTORY = PREFIX + "admin.factory";
+  // Configs related to retry policy of blob stores
+  private static final String RETRY_POLICY_PREFIX = PREFIX + "retry.policy.";
+  public static final String RETRY_POLICY_MAX_RETRIES = RETRY_POLICY_PREFIX + "max.retries";
+  // -1 for RetryPolicy means unlimited retries. Retry is limited by max retry duration, rather than count of retries.
+  public static final int DEFAULT_RETRY_POLICY_MAX_RETRIES = -1;
+  public static final String RETRY_POLICY_MAX_RETRY_DURATION_MILLIS = RETRY_POLICY_PREFIX + "max.retry.duration.millis";
+  public static final long DEFAULT_RETRY_POLICY_MAX_RETRY_DURATION_MILLIS = 15 * 60 * 1000; // 15 mins
+  public static final String RETRY_POLICY_BACKOFF_DELAY_MILLIS = RETRY_POLICY_PREFIX + "backoff.delay.millis";
+  public static final long DEFAULT_RETRY_POLICY_BACKOFF_DELAY_MILLIS = 100;
+  public static final String RETRY_POLICY_BACKOFF_MAX_DELAY_MILLIS = RETRY_POLICY_PREFIX + "backoff.max.delay.millis";
+  public static final long DEFAULT_RETRY_POLICY_BACKOFF_MAX_DELAY_MILLIS = 312500;
+  public static final String RETRY_POLICY_BACKOFF_DELAY_FACTOR = RETRY_POLICY_PREFIX + "backoff.delay.factor";
+  public static final int DEFAULT_RETRY_POLICY_BACKOFF_DELAY_FACTOR = 5;
+  public static final String RETRY_POLICY_JITTER_FACTOR =  RETRY_POLICY_PREFIX + "jitter.factor";

Review Comment:
   Please config also add this in pr description



-- 
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-unsubscribe@samza.apache.org

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