Skip to content

Add extstore s3 driver#2907

Open
cconstable wants to merge 1 commit into
masterfrom
extstore-s3-driver
Open

Add extstore s3 driver#2907
cconstable wants to merge 1 commit into
masterfrom
extstore-s3-driver

Conversation

@cconstable

@cconstable cconstable commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What changed?

  • Added the experimental S3 external storage driver and AWS SDK v2 adapter at contrib/temporal-payload-storage-s3/src/main/java/io/temporal/payload/storage/s3/
  • Added shared PayloadHasher for drivers to consistently hash payload content.

Why?

  • Enables Temporal payloads to be offloaded to S3 through the external storage driver API.

Checklist

  • Added focused S3 driver tests covering storage, retrieval, key format, error handling, validation, and README examples.

@cconstable cconstable changed the base branch from master to extstore-foundation June 10, 2026 18:59
@cconstable cconstable changed the title extstore s3 driver Add extstore s3 driver Jun 10, 2026
Comment thread temporal-sdk/src/main/java/io/temporal/payload/storage/PayloadHasher.java Outdated
@cconstable cconstable marked this pull request as ready for review June 10, 2026 20:21
@cconstable cconstable requested a review from a team as a code owner June 10, 2026 20:21
@cconstable

Copy link
Copy Markdown
Contributor Author

The actual changes here are only a few hundred lines. The vast majority of the diff is tests, comments, and java ceremony. storage/s3/S3StorageDriver.java is the big change.

Comment thread temporal-sdk/src/main/java/io/temporal/payload/storage/PayloadHasher.java Outdated
@cconstable cconstable marked this pull request as draft June 12, 2026 18:27
return withFailureContext(uploadRequest, "upload failed " + location);
})
.thenApply(ignored -> claimFor(bucket, key, hexDigest));
cancelRequestWhenCancelled(claimFuture, inFlightRequest);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What I had here previously did not properly cancel the upstream client request. Now cancellation should propagate correctly:

  1. client.objectExists(bucket, key); creates a future that eagerly executes.
  2. that is wrapped in a future that provides failure context via withFailureContext
  3. thenCompose chains the client.putObject request
  4. cancelRequestWhenCancelled(claimFuture, inFlightRequest); listens for a cancel on claimFuture and then reaches upstream and cancels the current inFlightRequest.

If there is a more elegant way to do this in Java please let me know. An alternative solution is returning an opaque cancellation token/context but now you've got two things to cancel and that might be confusing.

@cconstable cconstable marked this pull request as ready for review June 15, 2026 16:03
@cconstable cconstable force-pushed the extstore-foundation branch from 20914d5 to 4983bfe Compare June 15, 2026 16:03
Base automatically changed from extstore-foundation to master June 15, 2026 16:49
@cconstable

Copy link
Copy Markdown
Contributor Author

Merging the old base into master jumbled up the commits in this PR. Doing a rebase --onto and then force pushing to clean this up.

@cconstable cconstable force-pushed the extstore-s3-driver branch from 3fd31f5 to 9ca30be Compare June 18, 2026 17:20
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