Skip to content

[FLINK-40595][s3] Preserve multipart uploads during recoverable stream disposal - #29132

Open
mateczagany wants to merge 2 commits into
apache:masterfrom
mateczagany:FLINK-40595
Open

[FLINK-40595][s3] Preserve multipart uploads during recoverable stream disposal#29132
mateczagany wants to merge 2 commits into
apache:masterfrom
mateczagany:FLINK-40595

Conversation

@mateczagany

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Prevent the native S3 writer from aborting multipart uploads that may be needed for recovery. Previously, disposing an in-progress file during task shutdown or cancellation could invalidate checkpoint state, causing recovery to fail with NoSuchUpload.

Brief change log

  • Preserve uploads after successful persistence and when resuming from recoverable state
  • Document cleanup of abandoned uploads and its implications for recovery

Verifying this change

This change added tests and can be verified as follows:

  • Added unit tests covering failed first and subsequent persistence, disposal of an empty recovered stream, and concurrent persistence and disposal
  • Extended existing S3 integration tests to dispose the original stream before recovery
  • Added integration tests covering disposal of recovered streams, recovery after failed commit preparation, and cleanup of unpersisted uploads

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes — recovery of files written through the native S3 connector
  • The S3 file system connector: yes

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Codex GPT-6

@flinkbot

flinkbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Comment thread docs/content/docs/deployment/filesystems/s3.md
@gaborgsomogyi

gaborgsomogyi commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This adds a new field, a new constructor overload, and a concurrency edge case (persist()/close() race on uploadMayBeReferenced) just to distinguish "never persisted" from "persisted" uploads. I'm not yet convinced that we need 400 lines to fix this. Why don't we just skip abort in close()?

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants