flaming-archer opened a new pull request, #11393:
URL: https://github.com/apache/gravitino/pull/11393
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): Support xxx"
- "[#233] fix: Check null before access result in xxx"
- "[MINOR] refactor: Fix typo in variable name"
- "[MINOR] docs: Fix typo in README"
- "[#255] test: Fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
1、S3FileSystemProvider.java:
Add the missing key mapping GRAVITINO_S3_PATH_STYLE_ACCESS →
PATH_STYLE_ACCESS to GRAVITINO_KEY_TO_S3_HADOOP_KEY, so that user-configured
s3-path-style-access is properly translated to Hadoop's
fs.s3a.path.style.access.
2、FilesetS3CatalogIT.java:
Replace gravitinoLocalStackContainer.getContainerIpAddress() with
localhost:getMappedPort(4566) for the S3 endpoint, as the Docker internal
bridge IP is unreachable on macOS/Windows hosts.
Add fs.s3a.path.style.access=true to all S3 configuration points (direct
Hadoop FileSystem setup, catalog properties, and local catalog properties), so
that the LocalStack S3 endpoint is accessed via path-style URLs, which
LocalStack expects when the endpoint does not have the s3. prefix.
### Why are the changes needed?
Fix: https://github.com/apache/gravitino/issues/11391
Bug fix. Two issues cause FilesetS3CatalogIT to hang indefinitely on
non-Linux hosts:
1、S3FileSystemProvider.GRAVITINO_KEY_TO_S3_HADOOP_KEY maps Gravitino S3
configuration keys to Hadoop keys, but PATH_STYLE_ACCESS was missing. Users
setting s3-path-style-access=true would have it silently ignored.
2、On macOS (Docker Desktop), getContainerIpAddress() returns the Docker
bridge IP (e.g., 172.17.0.x) which is not routable from the host because Docker
runs inside a Linux VM. Connections to this IP hang until timeout.
Additionally, the endpoint http://localhost:4566 lacks the s3. prefix required
by LocalStack for virtual-hosted-style request routing. Without
fs.s3a.path.style.access=true, the Hadoop S3A connector constructs
virtual-hosted-style URLs that LocalStack cannot properly handle, as documented
in the [LocalStack S3 endpoint configuration
guide](https://hashnode.localstack.cloud/efficient-localstack-s3-endpoint-configuration).
### Does this PR introduce _any_ user-facing change?
No changes to public APIs. The s3-path-style-access property key already
existed in S3Properties, this PR only ensures it is properly propagated by
S3FileSystemProvider.
### How was this patch tested?
Ran FilesetS3CatalogIT on macOS.
--
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]