smengcl commented on code in PR #10759:
URL: https://github.com/apache/ozone/pull/10759#discussion_r4217021078


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneCluster.java:
##########
@@ -765,6 +841,61 @@ private void startDatanodes(List<OzoneConfiguration> 
datanodeConfigurations) {
     }
   }
 
+  private void startS3Gateway(OzoneConfiguration conf) throws Exception {
+    // Gateway reads its configuration from the static holder, and the reset 
is what lets a second
+    // in-JVM start win: setConfiguration() keeps the first value. Same pair 
as S3GatewayService.
+    OzoneConfigurationHolder.resetConfiguration();
+    OzoneConfigurationHolder.setConfiguration(new OzoneConfiguration(conf));

Review Comment:
   Explicit `x-amz-storage-class: STANDARD` bypasses the local 
`STAND_ALONE/ONE` defaults: `S3Utils.resolveS3ClientSideReplicationConfig()` 
maps it to `RATIS/THREE`, which the default one-datanode cluster cannot 
provide. Reproduced at this head: ordinary PUT/GET succeeds, while the same 
nonempty PUT with `.storageClass("STANDARD")` returns HTTP 500 with 
block-allocation errors. Could we handle storage-class requests in the local 
replication setup and add a STANDARD PUT/GET regression test? The current smoke 
test only creates and lists buckets.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/local/LocalOzoneCluster.java:
##########
@@ -610,6 +651,41 @@ private void configureOmStorage(OzoneConfiguration conf) {
         omMetadataDir.toString());
   }
 
+  private int configureS3Gateway(OzoneConfiguration conf,
+      PersistedPortState persistedPorts, PortAllocator portAllocator)
+      throws IOException {
+    if (!config.isS3gEnabled()) {
+      return -1;
+    }
+    // The runtime advertises an http:// endpoint and reads the bound port 
back off this
+    // listener, so a configuration that switches it off leaves nothing to 
report.
+    setLocalOverride(conf, OZONE_S3G_HTTP_ENABLED_KEY, true);

Review Comment:
   This does not ensure the HTTP connector is enabled: `BaseHttpServer` also 
obeys `ozone.http.policy`. With `HTTPS_ONLY`, startup succeeds but connecting 
to the advertised HTTP endpoint returns connection refused. `getHttpAddress()` 
retains the configured address even when that connector is disabled. Could we 
reject this incompatible policy during preparation and add a regression test? A 
small guard would be:
   
   ```diff
   +import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_HTTP_POLICY_KEY;
   +import org.apache.hadoop.hdds.server.http.HttpConfig;
   
   @@
        setLocalOverride(conf, OZONE_S3G_HTTP_ENABLED_KEY, true);
   +    if (!HttpConfig.getHttpPolicy(conf).isHttpEnabled()) {
   +      throw new IOException("Local S3 Gateway requires HTTP in " + 
OZONE_HTTP_POLICY_KEY + ".");
   +    }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to