Skip to content

Commit fc42da7

Browse files
authored
HADOOP-19357: [ABFS] Optimizations for Retry Handling and Client Side Throttling (#7216)
Default for following configs are changed: Client-side throttling (CST): Off Client Backoff - 500ms (reduced from 3sec) Max Backoff - 25s (reduced from 30sec) Min Backoff - 500ms (reduced from 3sec) Contributed by Manika Joshi (@manika137)
1 parent efb83ec commit fc42da7

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/constants/FileSystemConfigurations.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public final class FileSystemConfigurations {
3939
private static final int SIXTY_SECONDS = 60_000;
4040

4141
// Retry parameter defaults.
42-
public static final int DEFAULT_MIN_BACKOFF_INTERVAL = 3_000; // 3s
43-
public static final int DEFAULT_MAX_BACKOFF_INTERVAL = 30_000; // 30s
42+
public static final int DEFAULT_MIN_BACKOFF_INTERVAL = 500; // 500ms
43+
public static final int DEFAULT_MAX_BACKOFF_INTERVAL = 25_000; // 25s
4444
public static final boolean DEFAULT_STATIC_RETRY_FOR_CONNECTION_TIMEOUT_ENABLED = true;
4545
public static final int DEFAULT_STATIC_RETRY_INTERVAL = 1_000; // 1s
46-
public static final int DEFAULT_BACKOFF_INTERVAL = 3_000; // 3s
46+
public static final int DEFAULT_BACKOFF_INTERVAL = 500; // 500ms
4747
public static final int DEFAULT_MAX_RETRY_ATTEMPTS = 30;
4848
public static final int DEFAULT_CUSTOM_TOKEN_FETCH_RETRY_COUNT = 3;
4949

@@ -108,7 +108,7 @@ public final class FileSystemConfigurations {
108108

109109
public static final boolean DEFAULT_ENABLE_FLUSH = true;
110110
public static final boolean DEFAULT_DISABLE_OUTPUTSTREAM_FLUSH = true;
111-
public static final boolean DEFAULT_ENABLE_AUTOTHROTTLING = true;
111+
public static final boolean DEFAULT_ENABLE_AUTOTHROTTLING = false;
112112
public static final int DEFAULT_METRIC_IDLE_TIMEOUT_MS = 60_000;
113113
public static final int DEFAULT_METRIC_ANALYSIS_TIMEOUT_MS = 60_000;
114114
public static final boolean DEFAULT_FS_AZURE_ACCOUNT_LEVEL_THROTTLING_ENABLED = true;

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestExponentialRetryPolicy.java

+18
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ public void testDefaultMaxIORetryCount() throws Exception {
9696
testMaxIOConfig(abfsConfig);
9797
}
9898

99+
@Test
100+
public void testClientSideThrottlingConfigs() throws Exception {
101+
final Configuration configuration = new Configuration();
102+
configuration.setBoolean(FS_AZURE_ENABLE_AUTOTHROTTLING, true);
103+
AbfsConfiguration abfsConfiguration = new AbfsConfiguration(configuration,
104+
DUMMY_ACCOUNT_NAME);
105+
Assertions.assertThat(abfsConfiguration.isAutoThrottlingEnabled())
106+
.describedAs("Client-side throttling enabled by configuration key")
107+
.isTrue();
108+
109+
configuration.unset(FS_AZURE_ENABLE_AUTOTHROTTLING);
110+
AbfsConfiguration abfsConfiguration2 = new AbfsConfiguration(configuration,
111+
DUMMY_ACCOUNT_NAME);
112+
Assertions.assertThat(abfsConfiguration2.isAutoThrottlingEnabled())
113+
.describedAs("Client-side throttling should be disabled by default")
114+
.isFalse();
115+
}
116+
99117
@Test
100118
public void testThrottlingIntercept() throws Exception {
101119
AzureBlobFileSystem fs = getFileSystem();

0 commit comments

Comments
 (0)