Skip to content

Commit 343d4c8

Browse files
committed
HADOOP-19286: S3A: Support cross region access when S3 region/endpoint is set (ADDENDUM)
1 parent 4e6432a commit 343d4c8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/DefaultS3ClientFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ protected ClientOverrideConfiguration.Builder createClientOverrideConfiguration(
271271
* <li>If endpoint is configured via via fs.s3a.endpoint, set it.
272272
* If no region is configured, try to parse region from endpoint. </li>
273273
* <li> If no region is configured, and it could not be parsed from the endpoint,
274-
* set the default region as US_EAST_2 and enable cross region access. </li>
274+
* set the default region as US_EAST_2</li>
275275
* <li> If configured region is empty, fallback to SDK resolution chain. </li>
276+
* <li> S3 cross region is enabled by default irrespective of region or endpoint
277+
* is set or not.</li>
276278
* </ol>
277279
*
278280
* @param builder S3 client builder.

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3AEndpointRegion.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ public void testWithOutCrossRegionAccess() throws Exception {
356356
// skip the test if the region is sa-east-1
357357
skipCrossRegionTest();
358358
final Configuration newConf = new Configuration(getConfiguration());
359+
removeBaseAndBucketOverrides(newConf,
360+
ENDPOINT,
361+
AWS_S3_CROSS_REGION_ACCESS_ENABLED,
362+
AWS_REGION);
359363
// disable cross region access
360364
newConf.setBoolean(AWS_S3_CROSS_REGION_ACCESS_ENABLED, false);
361365
newConf.set(AWS_REGION, SA_EAST_1);
@@ -374,6 +378,7 @@ public void testWithCrossRegionAccess() throws Exception {
374378
skipCrossRegionTest();
375379
final Configuration newConf = new Configuration(getConfiguration());
376380
removeBaseAndBucketOverrides(newConf,
381+
ENDPOINT,
377382
AWS_S3_CROSS_REGION_ACCESS_ENABLED,
378383
AWS_REGION);
379384
// enable cross region access

0 commit comments

Comments
 (0)