Skip to content

fix(storage/s3): default to virtual-host-style addressing#2330

Merged
blackmwk merged 1 commit intoapache:mainfrom
plusplusjiajia:fix/s3-default-virtual-host-style
Apr 15, 2026
Merged

fix(storage/s3): default to virtual-host-style addressing#2330
blackmwk merged 1 commit intoapache:mainfrom
plusplusjiajia:fix/s3-default-virtual-host-style

Conversation

@plusplusjiajia
Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

What changes are included in this PR?

The Java Iceberg SDK defaults s3.path-style-access to false i.e. virtual-host-style addressing is the spec default. opendal's S3Config::default(), which the opendal storage backend inherits from, uses path-style. As a result, any user building an iceberg-rust FileIO against AWS S3 or an S3-compatible service has to explicitly set s3.path-style-access=false to get the same behavior they would get from Java out of the box — and several S3-compatible endpoints only accept virtual-host-style URLs and fail outright with SecondLevelDomainForbidden (or equivalent) under the current default.

Are these changes tested?

Yes:

  • cargo test -p iceberg --lib io::storage::config::s3::tests
  • `cargo test -p iceberg-storage-opendal --lib s3::tests

@plusplusjiajia plusplusjiajia force-pushed the fix/s3-default-virtual-host-style branch from 00b10ab to 3d843c5 Compare April 15, 2026 06:21
Copy link
Copy Markdown
Contributor

@blackmwk blackmwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @plusplusjiajia for this fix!

@blackmwk blackmwk merged commit d6692fc into apache:main Apr 15, 2026
20 checks passed
toutane pushed a commit to DataDog/iceberg-rust that referenced this pull request Apr 30, 2026
## Which issue does this PR close?
 N/A

## What changes are included in this PR?
The Java Iceberg SDK defaults [`s3.path-style-access` to
`false`](https://github.com/apache/iceberg/blob/main/aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIOProperties.java#L238-L240)
i.e. virtual-host-style addressing is the spec default. opendal's
`S3Config::default()`, which the opendal storage backend inherits from,
uses path-style. As a result, any user building an iceberg-rust `FileIO`
against AWS S3 or an S3-compatible service has to explicitly set
`s3.path-style-access=false` to get the same behavior they would get
from Java out of the box — and several S3-compatible endpoints only
accept virtual-host-style URLs and fail outright with
`SecondLevelDomainForbidden` (or equivalent) under the current default.

## Are these changes tested?
  Yes:
  - `cargo test -p iceberg --lib io::storage::config::s3::tests`
  - `cargo test -p iceberg-storage-opendal --lib s3::tests

(cherry picked from commit d6692fc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants