You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/12/16 12:18:56 UTC

[GitHub] [hadoop] ahmarsuhail opened a new pull request, #5230: HADOOP-18579. Warn when no region configured.

ahmarsuhail opened a new pull request, #5230:
URL: https://github.com/apache/hadoop/pull/5230

   ### Description of PR
   
   [Jira](https://issues.apache.org/jira/browse/HADOOP-18579)
   
   Warn when no region has been configured `fs.s3a.endpoint.region`. This is to prepare for the SDK V2 upgrade, in which requests to S3 will fail if the client is configured with an incorrect region. 
   
   ### How was this patch tested?
   
   Did not set `fs.s3a.endpoint.region`, and checked that warning is logged when running an integration test. Set the property, and checked that warning is not logged. 
   
   Also tested in `eu-west-1` by running `mvn -Dparallel-tests -DtestsThreadCount=16 clean verify`.
   
   
   


-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on pull request #5230: HADOOP-18579. Warn when no region configured.

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on PR #5230:
URL: https://github.com/apache/hadoop/pull/5230#issuecomment-1354862129

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 54s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  1s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  1s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | -1 :x: |  test4tests  |   0m  0s |  |  The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  41m  6s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 41s |  |  trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04  |
   | +1 :green_heart: |  compile  |   0m 34s |  |  trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08  |
   | +1 :green_heart: |  checkstyle  |   0m 31s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 41s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 25s |  |  trunk passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04  |
   | +1 :green_heart: |  javadoc  |   0m 29s |  |  trunk passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08  |
   | +1 :green_heart: |  spotbugs  |   1m 16s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  23m 33s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 30s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 36s |  |  the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04  |
   | +1 :green_heart: |  javac  |   0m 36s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 28s |  |  the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08  |
   | +1 :green_heart: |  javac  |   0m 28s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 31s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 13s |  |  the patch passed with JDK Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04  |
   | +1 :green_heart: |  javadoc  |   0m 21s |  |  the patch passed with JDK Private Build-1.8.0_352-8u352-ga-1~20.04-b08  |
   | +1 :green_heart: |  spotbugs  |   1m  9s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  23m 17s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   2m 44s |  |  hadoop-aws in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 33s |  |  The patch does not generate ASF License warnings.  |
   |  |   | 101m 24s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5230/1/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/5230 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux 287732bf8bc1 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / 6b030b6ee585fad93b5cab5b668c9efc3a3c222f |
   | Default Java | Private Build-1.8.0_352-8u352-ga-1~20.04-b08 |
   | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.17+8-post-Ubuntu-1ubuntu220.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_352-8u352-ga-1~20.04-b08 |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5230/1/testReport/ |
   | Max. process+thread count | 540 (vs. ulimit of 5500) |
   | modules | C: hadoop-tools/hadoop-aws U: hadoop-tools/hadoop-aws |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5230/1/console |
   | versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
   | Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] virajjasani commented on a diff in pull request #5230: HADOOP-18579. Warn when no region configured.

Posted by GitBox <gi...@apache.org>.
virajjasani commented on code in PR #5230:
URL: https://github.com/apache/hadoop/pull/5230#discussion_r1051156833


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/V2Migration.java:
##########
@@ -95,4 +99,13 @@ public static void v1GetObjectMetadataCalled() {
         + "will be changed as part of upgrading S3A to AWS SDK V2");
   }
 
+  /**
+   * Warns on use of getObjectMetadata.
+   */
+  public static void regionNotConfigured() {
+    WARN_ON_REGION_NOT_CONFIGURED.warn("A region has not been configured. Cross region support "
+            + "will be removed as part of upgrading S3A to AWS SDK V2. To avoid errors, set the "
+        + "bucket's region in {}.", AWS_REGION);
+  }

Review Comment:
   Since the method just logs and it is conditional by nature (as opposed to majority of logging methods in this class), to improve the readability, how about passing region name to the method and let it decide whether to warn?
   
   ```
     public static void warnIfRegionNotConfigured(String regionName) {
       if (StringUtils.isBlank(regionName)) {
         WARN_ON_REGION_NOT_CONFIGURED.warn("A region has not been configured. Cross region support "
             + "will be removed as part of upgrading S3A to AWS SDK V2. To avoid errors, set the "
             + "bucket's region in {}.", AWS_REGION);
       }
     }
   
   ```
   



-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] virajjasani commented on a diff in pull request #5230: HADOOP-18579. Warn when no region configured.

Posted by GitBox <gi...@apache.org>.
virajjasani commented on code in PR #5230:
URL: https://github.com/apache/hadoop/pull/5230#discussion_r1051156833


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/V2Migration.java:
##########
@@ -95,4 +99,13 @@ public static void v1GetObjectMetadataCalled() {
         + "will be changed as part of upgrading S3A to AWS SDK V2");
   }
 
+  /**
+   * Warns on use of getObjectMetadata.
+   */
+  public static void regionNotConfigured() {
+    WARN_ON_REGION_NOT_CONFIGURED.warn("A region has not been configured. Cross region support "
+            + "will be removed as part of upgrading S3A to AWS SDK V2. To avoid errors, set the "
+        + "bucket's region in {}.", AWS_REGION);
+  }

Review Comment:
   How about passing region name to the method and let the method decide whether to warn?
   
   ```
     public static void warnIfRegionNotConfigured(String regionName) {
       if (StringUtils.isBlank(regionName)) {
         WARN_ON_REGION_NOT_CONFIGURED.warn("A region has not been configured. Cross region support "
             + "will be removed as part of upgrading S3A to AWS SDK V2. To avoid errors, set the "
             + "bucket's region in {}.", AWS_REGION);
       }
     }
   
   ```
   



##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/DefaultS3ClientFactory.java:
##########
@@ -234,6 +236,12 @@ protected AmazonS3 buildAmazonS3Client(
     AmazonS3ClientBuilder b = AmazonS3Client.builder();
     configureBasicParams(b, awsConf, parameters);
 
+    String region = getConf().getTrimmed(AWS_REGION);
+
+    if (StringUtils.isBlank(region)) {
+      V2Migration.regionNotConfigured();
+    }
+
     // endpoint set up is a PITA
     AwsClientBuilder.EndpointConfiguration epr
         = createEndpointConfiguration(parameters.getEndpoint(),

Review Comment:
   nit: `getConf().getTrimmed(AWS_REGION)` passed to `createEndpointConfiguration()` can be replaced with `region`



-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org