Skip to content

[FSTORE-2163] S3 data source: support S3-compatible storage (custom endpoint, path-style access, private CA, legacy checksums) - #1442

Open
bubriks wants to merge 13 commits into
logicalclocks:mainfrom
bubriks:FSTORE-2163
Open

bubriks wants to merge 13 commits into
logicalclocks:mainfrom
bubriks:FSTORE-2163

Conversation

@bubriks

@bubriks bubriks commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

JIRA: https://hopsworks.atlassian.net/browse/FSTORE-2163

Summary

Client side of S3-compatible storage support for the S3 data source. Without an endpoint every path behaves as before, including the legacy fs.s3a.* Spark options.

  • Python S3Connector: endpoint and path_style_access are sent on save and update. Saving, updating and FeatureStore.create_data_source refuse an endpoint on a backend older than 5.3 before the request, and raise when a backend whose version the client does not know drops it, rather than silently targeting AWS.
  • Engines:
    • Spark sets the endpoint, path style and TLS flag at bucket scope only, so a later AWS data source in the same session is not redirected.
    • Spark writes the data source's region after the forwarded options, so fs.s3a.endpoint.region cannot make Spark sign for another region than the backend.
    • Spark gives an endpoint bucket its own credentials provider, the static one or the temporary one with the data source's own token, unless the data source's options name one, so the bucket never takes a provider another data source set for the whole session.
    • Spark raises FeatureStoreException when a data source uses a bucket name the application already uses with another store or endpoint, since s3a keeps one filesystem per bucket name for the life of the application. A Glue table counts with the bucket of its location, and so does an absolute path a data source without an endpoint reads. The check holds across a reconnect to Hopsworks and across a new SparkContext in the same process, whose JVM keeps Hadoop's filesystem cache, and a refused data source leaves the session's settings and claims as they were. Claims are taken under a lock, so two concurrent reads cannot claim one bucket for different stores. A data source with an endpoint raises for a path in another bucket, since its endpoint is set for its own bucket only. Data sources without an endpoint behave as before unless the application also uses their bucket name with an endpoint.
    • boto3, delta-rs and PyIceberg receive the endpoint and addressing style. The boto3 reader computes and validates checksums only when required.
    • PyArrow 25.0.1 (aws-sdk-cpp 1.11.800) sends a CRC64NVME trailer on every upload, which stores such as ECS refuse, and neither PyArrow nor PyIceberg exposes the SDK's switch. An endpoint data source therefore loads hsfs.core.iceberg_file_io._WhenRequiredChecksumFileIO through py-io-impl. It sets AWS_REQUEST_CHECKSUM_CALCULATION and AWS_RESPONSE_CHECKSUM_VALIDATION to when_required only while it builds its own S3 filesystem, since the SDK reads them when it builds a client. Other AWS clients in the process keep their defaults.
    • Accepted risk: an AWS client that another thread builds during one such construction also takes when_required. This is documented on the class. Codex rated it Must Fix and proposed a worker process instead; see Review notes.
  • connector_options(): derives its DuckDB-style keys from the endpoint. It no longer treats "false" in fs.s3a.connection.ssl.enabled or fs.s3a.path.style.access as true.
  • Java SDK: writes the endpoint, path style, credentials, credentials provider and region at bucket scope, a provider the data source's options name taking precedence, with or without a session token. It refuses a second store for a bucket name the same way, Glue tables included, and a location in another bucket for a data source with an endpoint. It claims the bucket of a location a data source without an endpoint reads.
  • CLI: --endpoint and --path-style-access. Creation fails when the cluster predates the endpoint and drops it. The data source skills describe the flags.
  • Arrow Flight errors: when the Arrow Flight server refuses a data source's endpoint because it resolves to a loopback, link-local or unspecified address, the read error says so, without the host. Before, it said only that the read failed.
  • Fixes:
    • The boto3 reader paginated on a key boto3 never returns and stopped at 1000 objects.
    • The delta-rs history read opened S3 tables without credentials.
    • The GCS Iceberg test left GOOGLE_APPLICATION_CREDENTIALS set for the rest of the test session.

Review notes

A Codex pre-review and two second-opinion rounds covered the checksum isolation. The process-wide variables were replaced after round 1 showed they change unrelated AWS clients. The remaining disagreement is the construction-window race above: the window is one S3 filesystem construction with no network call, and a worker process would move every endpoint Iceberg read and write across a process boundary.

Related PRs

Merge hopsworks-api before loadtest, hopsworks-helm and logicalclocks.github.io: the new loadtest modules fail on a client without the endpoint, and the docs build reads the API reference from hopsworks-api main, so its CI fails until then.

Test plan

  • Full Python suite on 6110a9c3ae, rebased onto main: 8677 passed. The 5 avro tests that fail also fail on the base commit: the local environment lacks spark-avro.
  • check_pep8_public.py and check_importable.py pass.
  • Java SDK tests under JDK 17 with -Pspark-4.1 -Dspark.version=4.1.3: hsfs 49, hsfs-spark 103 on e0a66ced6b, including the bucket provider with and without a session token, a provider named in the options, Glue locations, a location in another bucket, an AWS location in a bucket another store uses and one-store-per-bucket-name cases.
  • A real boto3 client in the endpoint reader sends no x-amz-checksum-* header on ListObjectsV2 or GetObject; without the fix GetObject sends x-amz-checksum-mode.
  • Local fake S3 server with PyArrow 25.0.1: see below.
  • Cluster verification below.

Cluster verification

Dev cluster bubriks (Hopsworks 5.3.0-SNAPSHOT running this ticket's backend, UI and flyingduck). The S3-compatible store is the cluster's MinIO (RELEASE.2024-03-26), which refuses DeleteObjects without Content-MD5 with the same error as Dell ECS.

The loadtests, the checksum trace and the validation checks ran on 2026-11-12 on the PR heads: ee 04f2882347 (rebased onto master with HWORKS-3338), api b4b5edf73c, front 3afa3f65, flyingduck 99f134c, loadtest 300a12d. The CA chain runs used loadtest 4cbe845: the full modules ran with a first version of its new case that upserted once, and the case as committed ran again on its own. The client in the test pod and in the Spark images was built from api a0dad9a5b6; the api commits after it change docstrings, help text and a Java test only. Hopsworks was installed from the hopsworks-helm head b6583d3c. The chart's Flyway run then applied master's V141 (HWORKS-3338 project roles) and this ticket's V142 on top of FSTORE-2158's V140, the path an upgrade takes. The upgrade baseline and the negative control ran on 2026-11-10 with ee 01a56826c0; the ee changes since then refuse more endpoint forms, fix clearing an endpoint and default the region of a data source with an endpoint, and unit tests and the validation checks cover them.

  • Upgrade: after the deploy the 85 existing S3 data sources have both new columns empty, and the GET JSON of an AWS data source and of a MinIO one configured through fs.s3a.* Spark options is the same before and after.
  • Validation: 11 invalid configurations are refused with their expected messages. A data source with an endpoint and no region is stored with us-east-1. The cluster's MinIO runs with region eu-west-1, so browsing that data source fails with the store's expecting 'eu-west-1' error, as a wrong region does. A wrong secret or host also fails with a clear error. No response echoes a secret or the endpoint.
  • Negative control: MinIO refuses DeleteObjects without Content-MD5 (MissingContentMD5) and accepts it with Content-MD5.
  • Loadtests: the new S3_COMPATIBLE modules (loadtest PR).
    • Python driver, 6/6: browse, external feature group over Arrow Flight, managed DELTA and ICEBERG feature groups, folder-bounded delete, training dataset sink, update without the endpoint fields keeps the endpoint.
    • PySpark driver, 3/3: managed DELTA, HUDI and ICEBERG feature groups.
  • Checksum trace: a MinIO request trace over the loadtest run (3039 requests). No upload from the backend, Spark, delta-rs or PyIceberg carries a flexible checksum. Every DeleteObjects from the backend (7), Spark (5) and the tests' cleanup (2) carries Content-MD5.
  • Private CA (hopsworks-helm and docs PRs): a second MinIO served over https:// with a certificate from a test CA (cert-manager), a third one from another CA, and a Service name the certificate does not cover. Kyverno 1.13.1 (chart 3.3.3), ca-pemstore built as the new docs page describes, Hopsworks upgraded from hopsworks-helm 566e877f with the page's values, existing project namespaces resynced.
    • Before the upgrade the backend refuses all three stores (PKIX). After it, it browses the trusted store, and still refuses the other CA (PKIX) and the uncovered name (subject alternative names). The trusted data source has no region and is stored with us-east-1.
    • Loadtests against the trusted store: Python driver 6/6 (361 s), PySpark driver 3/3 (469 s).
    • In a pod the policy mutated, Python reaches public HTTPS sites (pypi.org, github.com) and the trusted store, and refuses the other CA.
    • The store's trace (2589 requests) shows the backend, Spark s3a, boto3, delta-rs, PyArrow and DuckDB through Arrow Flight all reaching it over TLS, with no flexible checksum on an upload and Content-MD5 on every DeleteObjects.
  • Private CA chain and rotation: two more MinIOs with a certificate from a test issuing CA that a test root CA signs, one sending the issuing CA with its certificate and one sending its certificate alone.
    • Per client, in pods with each bundle mounted as the policy mounts it: with the root CA only, Python ssl, boto3, PyArrow, delta-rs, DuckDB and Java reach the store that sends the issuing CA and refuse the other; with the issuing CA only, boto3 refuses both stores (unable to get issuer certificate) while the other five accept them; with both, all six reach both. The docs page now asks for the root and every intermediate CA.
    • The bundle was rotated from the first test CA to the chain as the docs page's Rotate section says, with the issuing CA as a key of its own and an items entry for it. Afterwards the backend browses both chain stores and refuses the store of the rotated-out CA.
    • Loadtests against the store that sends the issuing CA, after the rotation: Python driver 7/7 (311 s, with a new case below), PySpark driver 3/3 (524 s).
  • Large writes and vacuum: a new Python-driver case writes a million-row Delta feature group, upserts it twice and vacuums it. The trace shows delta-rs uploading in parts (2 uploads, 28 parts) with no checksum, and the vacuum deleting each replaced file with its own DeleteObject request, so delta-rs never sends DeleteObjects. The trace of the whole run (2795 requests) has no violation: the only DeleteObjects senders are the backend and Spark, with Content-MD5 next to CRC32 every time, and the tests' cleanup.
  • Review fixes (Copilot round 1), on the current heads: ee 8e4710a5cc, api d5039f70ac (the client in the test pod and the Spark images), front d612b32c, flyingduck b81f6b1, loadtest d855646, against the store that sends the issuing CA.
    • A data source whose endpoint host is the name ip6-localhost, which the server pods resolve to ::1, is refused when the backend's S3 client resolves it. The user sees the SDK's generic unknown-host error; the server log names the loopback address. A data source on the cluster's MinIO, a private ClusterIP, still reaches the store.
    • Loadtests: Python driver 7/7 (339 s), PySpark driver 3/3 (551 s); the Spark driver checks that the endpoint bucket carries the static credentials provider at bucket scope.
    • The trace (2912 requests) has no violation; the backend's DeleteObjects, now sent through the SDK's Apache HTTP client with the endpoint resolver, carry Content-MD5 over TLS.
  • Review fixes (Copilot round 2): api cb3c4b850d (the client in the test pod and the Spark images), flyingduck 9d96b27, loadtest 26ce984, against the store that sends the issuing CA. The backend stayed on the round 1 build, since ee 29edc0c57a changes only toString.
    • Loadtests: Python driver 7/7 (331 s), PySpark driver 3/3 (497 s), none skipped. The training dataset sink case now checks that the files are under the data source's path and that the default HopsFS training dataset directory does not exist.
  • Review fixes (Copilot round 3): api ee9f60eada (the client in the test pod and the Spark images), loadtest f143ef9, Arrow Flight and the backend as in round 2 (ee a83f8e4a49 changes only request validation), against the store that sends the issuing CA.
    • Loadtests: Python driver 7/7 (311 s), PySpark driver 3/3 (529 s), none skipped. The Spark driver expects the credentials provider the client picks for the endpoint bucket.
  • The remaining client paths: loadtest 34a1c41, api ee9f60eada (the client in the test pod and the Spark images), Arrow Flight from flyingduck 1997be3.
    • New cases. Spark browses the store and reads an external feature group, reads the data source's path with connector.read, refuses a path in another bucket, writes a training dataset to the store, and reads through a data source set up with fs.s3a.* Spark options, as clusters before 5.3 had it. Python reads with connector.read, creates a data source with the CLI's --endpoint and --path-style-access, and an endpoint whose host name resolves to loopback (ip6-localhost) is refused by the backend and by Arrow Flight.
    • Against the store that sends the issuing CA (path-style): Python driver 10/10, PySpark driver 7/7, none skipped.
    • Against a MinIO serving virtual-hosted requests (MINIO_DOMAIN on an sslip.io name for its ClusterIP, path-style access off): Python driver 10/10, PySpark driver 7/7, none skipped. The first Python run failed on Delta reads through Arrow Flight with InvalidBucketName: DuckDB 2.0.0's Delta reader builds virtual-hosted URLs without the bucket for a custom endpoint. flyingduck 1997be3 reads Delta tables with path-style requests.
    • Upgrade test tests/upgrade/test_data_source.py, run before and after on this version: a data source set up with fs.s3a.* Spark options keeps its stored fields, with no endpoint, and Spark reads the store through it.
  • Review fixes of 2026-11-16, on the heads rebased onto the default branches: backend from ee 8dd9c5d3be and UI from front fdd4a210, both redeployed; api e0a66ced6b (the client in the test pod and the Spark images); loadtest 5442df2; Arrow Flight from flyingduck 1997be3 (the rebase changed only its Dockerfile). Against the store that sends the issuing CA.
    • Loadtests: Python driver 10/10 (323 s), PySpark driver 9/9 (888 s), none skipped. A data source without an endpoint given a path in the endpoint data source's bucket is refused after it in the same Spark application, and accepted with no endpoint for that bucket in a clean one.

Local checks on the PR heads:

  • Migration: CI's RonDB rehearsal (.github/scripts/rondb_rehearsal/rehearse.sh) with this branch's migration image. RonDB 26.02.10 seeded at V139 (32 tables of 40000 rows), V140, V141 and V142 applied by Flyway 13.11.1 in 1.621 s, 0 failed rows, no table copied. DatabaseTest.testFlywayMigration applies all 138 migrations up to V142.
  • Migration renumbered: master's HWORKS-3732 took V142 and HWORKS-1545 took V143, so this ticket's migration is V144 with the same SQL. DatabaseTest applies all 140 migrations up to V144, and check_ddl_rondb.py passes on it. The rehearsal and the cluster runs above applied it as V142.
  • PyIceberg checksums: a local fake S3 server with PyArrow 25.0.1 and PyIceberg 0.12.0. The file IO an endpoint data source loads uploads with no CRC64NVME trailer, while filesystems built before and after it send the trailer, and the environment is left as it was.

Not covered:

  • Stores other than MinIO, such as Dell ECS or Ceph. MinIO enforcing the same Content-MD5 rule as Dell ECS stands in for them.
  • Conditional writes. Delta commits from the Python engine send If-None-Match: *; the dev cluster's MinIO ignores it, so the loadtests show the commits work without it, not that a store enforces it. Whether Dell ECS 4.1 does is unknown.
  • The stock image. The cluster's spark-feature-pipeline base image was rebuilt with this branch's client, which the Spark jobs and the utility Spark jobs of the Python-engine flows (managed feature groups, training dataset sink) ran; the test pod installed the same client. The stock image ships the released client, which ignores the endpoint, so with it the managed feature group and training dataset sink tests fail with AWS 403s until images are built from merged code.
  • IAM-role data sources (no role mapping on the dev cluster): unit tests only.
  • Virtual-hosted addressing over TLS: the virtual-hosted store served plain http.
  • Delta reads through Arrow Flight from a store that accepts only virtual-hosted requests: they use path-style requests.
  • Upgrades from the two previous release minors with data. The migration rehearsal above starts at V139, and the new upgrade test ran before and after on one version, not across an upgrade.
  • The Java client on a cluster. Its changes are in the Spark engine, and the loadtest Java harness runs without Spark: unit tests only.
  • The rest of the loadtest suite, including the existing AWS S3 modules.
  • The private CA policy with its preconditions on. The run turned them off, as the docs page says to, so every pod got the bundle; Arrow Flight's opt-in annotation is covered by a chart property test.
  • A store that sends its certificate alone with only the root CA in the Hopsworks server's truststore: the run gave the server the issuing CA as well, as the docs page now says.
  • An answer that changes between the Arrow Flight server's address check and DuckDB's own lookup (FSTORE-2167). The server checks the resolved addresses before it creates the DuckDB secret, and DuckDB resolves the host again itself; the backend's check holds at every connection.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical connector-state leakage can redirect AWS operations to custom stores and expose unrelated session tokens, while a new Java test throws before reaching its assertions.

5 open issues
What changed in this PR

Adds S3-compatible storage support across the Python and Java clients, execution engines, and CLI while preserving legacy AWS configuration paths. Private CA support remains deferred.

Changes:

  • Adds endpoint and addressing-style fields, CLI flags, and checks for backends that discard endpoints.
  • Configures Spark, boto3, delta-rs, and PyIceberg for custom stores, including checksum compatibility.
  • Fixes S3 pagination and Delta history credentials, expands tests, and updates data-source guidance.
File Description
python/​tests/​test_storage_connector.py Tests endpoint serialization, options, and backend compatibility checks.
python/​tests/​fixtures/​storage_connector_fixtures.json Adds endpoint fields to the S3 fixture.
python/​tests/​engine/​test_spark.py Tests bucket-scoped endpoint settings and region precedence.
python/​tests/​engine/​test_python.py Tests pagination, empty listings, endpoints, and checksum headers.
python/​tests/​core/​test_iceberg_engine.py Tests endpoint file IO and environment restoration.
python/​tests/​core/​test_delta_engine.py Tests custom S3 storage options.
python/​tests/​cli/​test_datasource.py Tests endpoint flags and older-backend detection.
python/​hsfs/​storage_connector.py Adds endpoint fields, persistence checks, and connector options.
python/​hsfs/​engine/​spark.py Applies endpoint settings at bucket scope.
python/​hsfs/​engine/​python.py Configures boto3 endpoints and fixes listing pagination.
python/​hsfs/​core/​iceberg_file_io.py Adds checksum-compatible PyIceberg file IO.
python/​hsfs/​core/​iceberg_engine.py Selects endpoint properties and compatible file IO.
python/​hsfs/​core/​delta_engine.py Adds endpoint options and credentials for history reads.
python/​hopsworks/​skills/​ml/​hops-reqs/​references/​data-sources.md Documents S3-compatible connection requirements.
python/​hopsworks/​skills/​data/​hops-data-sources/​SKILL.md Adds an S3-compatible CLI example.
python/​hopsworks/​cli/​commands/​datasource.py Adds endpoint flags and detects discarded endpoints.
java/​spark/​src/​test/​java/​com/​logicalclocks/​hsfs/​spark/​TestStorageConnector.java Adds bucket-scoped endpoint configuration coverage.
java/​spark/​src/​main/​java/​com/​logicalclocks/​hsfs/​spark/​engine/​SparkEngine.java Applies bucket-scoped endpoints, credentials, and region.
java/​hsfs/​src/​main/​java/​com/​logicalclocks/​hsfs/​StorageConnector.java Adds endpoint and path-style fields.

Review effort: Balanced

Comment thread python/hsfs/engine/spark.py Resolved
Comment thread python/hsfs/engine/spark.py Resolved
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  python/hopsworks/cli/commands
  datasource.py 2962-2963
  python/hsfs
  feature_store.py
  storage_connector.py
  python/hsfs/core
  arrow_flight_client.py
  delta_engine.py 432-437, 879, 897
  iceberg_engine.py 1722, 2056
  iceberg_file_io.py
  storage_connector_api.py 163, 180
  python/hsfs/engine
  python.py 761
  spark.py
Project Total  

This report was generated by python-coverage-comment-action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread python/hsfs/engine/spark.py Resolved
Comment thread python/hsfs/engine/spark.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active issues can silently drop custom endpoints or route cross-bucket reads to AWS or another store in both SDKs, while Java also ignores an explicitly configured credentials provider when a session token is present.

4 open issues
4 resolved since last review

Review effort: Balanced

Comment thread python/hsfs/engine/spark.py Resolved
Comment thread python/hsfs/storage_connector.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because both Spark engines can miss bucket collisions during cross-bucket AWS reads, allowing another store’s endpoint and credentials to be used.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

@dhananjay-mk dhananjay-mk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FSTORE-2163 review summary: security, regression and maintainability

Reviewed commit 204717d alongside the six sibling PRs.

  • Must Fix: The store-collision guard still misses an AWS connector reading an absolute S3 path in a different bucket. Both Python and Java check the connector's configured bucket rather than the actual read bucket. The inline comments describe the remaining case.
  • Should Fix: Python's process-global bucket registry has no Spark application identity, so a new engine/application in the same process retains prior bucket claims. Preserve reconnect protection while defining safe retirement of claims when the underlying application and filesystem cache change.
  • Maintenance risks: The PyIceberg private FileIO override temporarily changes process-wide checksum environment settings. Its lock does not coordinate unrelated client creation in other threads. Also consider rejecting known older backends before endpoint create/update requests; the response check currently detects endpoint loss after the mutation.

A source-level A/B probe held the AWS connector and read path constant. Without prior endpoint configuration, the read path had no custom bucket endpoint; with prior configuration, it retained https://store.example.com and no collision was raised. This verifies configuration state, not a live Spark network request. A separate isolated probe confirmed registry retention across fresh engine objects.

Observed CI unit matrices/importability/lint/docs/public-API checks passed. Release verification should include the existing AWS S3 workflows, IAM-role paths, Java Spark integration, and the actual published runtime images. The PR set reports branch-built images, not stock image verification.

Validation scope: static cross-project review, targeted local configuration probes, and GitHub CI inspection. No live cluster tests were rerun. JIRA/Confluence acceptance criteria were unavailable in this session.

Comment thread python/hsfs/engine/spark.py Resolved
Comment thread python/hsfs/engine/spark.py Resolved
@bubriks

bubriks commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The two Must Fix threads are fixed in d9e843b and the lifetime thread is answered inline. On the maintenance points: creating or updating a data source with an endpoint on a backend older than 5.3 is now refused before the request, as tags are, and the response check stays for a backend whose version the client does not know. The PyIceberg checksum override is the accepted risk in the PR description: the environment change is scoped and locked, and an AWS client another thread builds during it also takes when_required. The branches are rebased onto the default branches.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical race conditions in the Python and Java validation-and-claim sequences allow concurrent reads to claim the same bucket for different stores, potentially accessing the wrong store.

2 open issues

Review effort: Balanced

Comment thread python/hsfs/engine/spark.py Resolved
@bubriks
bubriks marked this pull request as ready for review November 16, 2026 09:00
@bubriks
bubriks requested a balanced review from Copilot November 16, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate potential authentication regressions from overridden storage settings and an untested Delta history path that can silently fall back.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

bubriks and others added 3 commits November 20, 2026 10:31
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

An S3 data source could only target AWS. Stores such as Dell ECS,
MinIO or Ceph were reachable only through Hadoop options in the data
source's Spark options, which Spark honoured but backend browsing and
deletion, the Python engine's Delta and Iceberg paths and Arrow Flight
reads ignored or applied in part. The data source gains an endpoint
and a path-style setting as the only opt-in; the backend, the Python
and Java SDKs, flyingduck and the UI each honour them, and data
sources without an endpoint behave as before.

The Python S3Connector exposes endpoint and path_style_access, sends
them on save and update, and raises when an older backend drops a
requested endpoint instead of silently targeting AWS. Every Python
path that reaches S3 through the connector uses them: Spark writes
the endpoint, path style and TLS flag at bucket scope only, so a
later AWS data source in the same session is not redirected; boto3
reads, delta-rs (whose object_store takes a virtual-hosted endpoint
with the bucket in it) and PyIceberg receive the endpoint and
addressing style. Without an endpoint every path behaves as before,
including the legacy fs.s3a.* Spark options. connector_options()
derives its DuckDB-style keys from the endpoint, and no longer treats
"false" in fs.s3a.connection.ssl.enabled or fs.s3a.path.style.access
as true. The Java SDK writes the same settings, credentials and
region at bucket scope. The CLI gains --endpoint and
--path-style-access, and the data source skills describe them.

Two fixes ride along: the boto3 reader paginated on a key boto3 never
returns and stopped at 1000 objects, and the delta-rs history read
opened S3 tables without credentials.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

A MinIO request trace from the S3-compatible loadtests showed the
Python engine's Iceberg writes sending every upload as aws-chunked
with an x-amz-checksum-crc64nvme trailer. They go through PyIceberg's
PyArrow file IO, whose aws-sdk-cpp (1.11.800 in PyArrow 25.0.1) adds
the trailer by default. Stores such as Dell ECS refuse flexible
checksums on PUT and multipart upload. Delta (delta-rs), Spark and the
backend sent none.

Neither PyArrow nor PyIceberg exposes the SDK's checksum switch, so a
data source with an endpoint sets the SDK's process-wide
AWS_REQUEST_CHECKSUM_CALCULATION and AWS_RESPONSE_CHECKSUM_VALIDATION
to when_required, keeping a value the user already set. An A/B against
MinIO with PyArrow 25.0.1 showed the trailer gone with the variables
set, also when set after pyarrow is imported. Data sources without an
endpoint leave the environment as it was.

The S3 test now asserts the variables per case, and a new test that a
user's value is kept. The S3 and GCS tests restore os.environ through
patch.dict: monkeypatch.delenv on an absent variable records nothing,
so the GCS test left GOOGLE_APPLICATION_CREDENTIALS set for the rest
of the session.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

A review before opening the pull requests found four gaps in the
client.

The Iceberg path set AWS_REQUEST_CHECKSUM_CALCULATION and
AWS_RESPONSE_CHECKSUM_VALIDATION for the whole process once a data
source with an endpoint was used, so every AWS client built later in
that process, in user code too, sent checksums only when required: a
PutObject with an Object Lock retention then carries neither a
checksum nor Content-MD5, which S3 requires there. aws-sdk-cpp reads
the variables when it builds a client, so an endpoint data source now
loads a PyArrow file IO, through PyIceberg's py-io-impl property,
that sets them only while it builds its own S3 filesystem and removes
them afterwards, keeping any value set by the user or by another
thread meanwhile. Against a local fake S3 server with PyArrow 25.0.1,
the filesystem built that way sends no CRC64NVME trailer, while ones
built before and after it send the trailer as before. A catalog named
through the iceberg.catalog write option gets the same file IO unless
the options name one. An AWS client that another thread builds during
one such construction still takes the setting: an accepted risk,
documented on the class.

The boto3 client that reads an endpoint data source's files left
botocore's default response validation on, so GetObject sent
x-amz-checksum-mode, a flexible checksum header such stores may
refuse. It now computes and validates checksums only when required,
on botocore versions that have those options.

A Spark option fs.s3a.endpoint.region overrode the data source's
region at bucket scope, so Spark signed for another region than the
backend and the Java SDK. The typed region is now written after the
forwarded options.

The CLI reported success when a cluster that predates S3-compatible
storage dropped the endpoint and created an AWS data source; it now
fails, as Python save() does.

Reviewed-by: OpenAI Codex (codex-plugin-cc 1.0.6) <codex@openai.com>
Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bubriks and others added 9 commits November 20, 2026 10:31
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

A regression test for saving an S3 data source with an endpoint and
tags together: the tags reach the create request and a response that
kept the endpoint is returned as is.

Reviewed-by: OpenAI Codex (codex-plugin-cc 1.0.6) <codex@openai.com>
Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

Make the region of an S3 data source with an endpoint optional. Without
one the backend stores us-east-1, which S3-compatible stores without
regions accept, instead of refusing the data source.

The S3Connector and endpoint docstrings, the CLI's --region and
--endpoint help and the data source skills say that the region defaults
to us-east-1 with an endpoint.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

The bucket-scoped endpoint test sets the S3 connector type, which
SparkEngine.setupConnectorHadoopConf dispatches on since the Spark 4.1
upgrade; without it the test failed with a NullPointerException under
the spark-4.1 profile.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

In the Python and Java Spark engines, a data source with an endpoint
sets its bucket's credentials provider: the static provider, or the
temporary one with the data source's own token when it has one. A
provider named in the data source's options wins. The bucket no longer
takes the global provider an earlier data source left in the session.

s3a keeps one filesystem per bucket name for the life of the
application, so both engines now record which store each bucket name is
used with and raise FeatureStoreException when a data source uses the
name with another store or endpoint, instead of reaching the first one.
Data sources without an endpoint on the same bucket name behave as
before.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

The Spark engines enforce one store per bucket name more widely.

The Python engine keeps the bucket registry for the process instead of
per engine: reconnecting builds a new engine, while the Spark
application and its S3 filesystems stay. It records the bucket before
changing any Hadoop setting, so a refused data source leaves the
session as it was.

A Glue data source has no bucket of its own. Both engines record the
bucket of the path it reads, so a Glue table and an S3 data source
with an endpoint cannot share a bucket name in one application, in
either order. The Java engine's read passes the location for this.

The Java engine sets a credentials provider that an endpoint data
source names in its options at bucket scope, as the Python engine
already does, and the static provider otherwise.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

An S3 data source with an endpoint sets the endpoint for its own bucket
only, so reading or writing an absolute path in another bucket reached
AWS, or another store the application had configured for that bucket
name. The Python and Java Spark engines now raise FeatureStoreException
for such a path before any Hadoop setting changes. Data sources without
an endpoint keep reading other buckets as before.

FeatureStore.create_data_source refuses a response that dropped the
endpoint, as StorageConnector.save does, so an older backend cannot
silently turn the data source into an AWS one.

With a session token, the Java engine now gives the endpoint bucket the
credentials provider the data source's options name, defaulting to the
temporary provider, as the Python engine does.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

When the Arrow Flight server refuses a data source's endpoint because
its host resolves to a loopback, link-local or unspecified address, the
read error now says so after "Could not read data using Hopsworks Query
Service.", as it does for an Oracle refusal. The message leaves out the
host, which stays in the server's own error. Before, the reason was
only in the exception's cause.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

A data source without an endpoint may read an absolute path in another
bucket, which Spark opens with whatever that bucket is configured for.
After a data source with an endpoint set that bucket up, the read went
to its store with its keys and no error. The Python and Java Spark
engines now record the path's bucket as well as the data source's own,
both before any Hadoop setting, and either both or neither, so a read
of a bucket another store uses raises FeatureStoreException and a
refused data source claims nothing.

The bucket registry stays for the process: every SparkContext of a
PySpark process runs in the same JVM, and Hadoop's filesystem cache
returned the same instance after stop() and a new context (PySpark
4.1.1). The error now says to use a new Spark application process.

Creating or updating an S3 data source with an endpoint on a backend
older than 5.3 is refused before the request, as tags are, instead of
after the backend stored the data source without the endpoint. The
response check stays for a backend whose version the client does not
know.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndpoint, path-style access, private CA, legacy checksums)

https://hopsworks.atlassian.net/browse/FSTORE-2163

Claiming a data source's buckets checks every bucket and then records
them, so two reads with different stores for the same new bucket could
both pass the check before either recorded it, and both would use the
bucket. The Python engine now holds a module-level lock, shared by all
Engine instances, across the check and the record, and the Java
engine's claim is synchronized. A test pauses one claim between its
check and its record while a second one runs; with the lock exactly
one store gets the bucket, without it both do.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python/tests/core/test_delta_engine.py conflicted only because both
sides append test classes at the end of the file: this branch's
TestDeltaRsStorageOptionsS3 and main's TestReplaceWrite, _DeltaLog and
TestDeltaRsLog. Both are kept. Main's new delta-rs paths take their
storage options from _get_delta_rs_storage_options, so they carry the
data source's endpoint settings as well.

Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants