Skip to content

fix: prevent orphaned sessions when lakeFS abort fails#4197

Open
xuang7 wants to merge 7 commits intoapache:mainfrom
xuang7:fix/multipart-abort-cleanup
Open

fix: prevent orphaned sessions when lakeFS abort fails#4197
xuang7 wants to merge 7 commits intoapache:mainfrom
xuang7:fix/multipart-abort-cleanup

Conversation

@xuang7
Copy link
Contributor

@xuang7 xuang7 commented Feb 9, 2026

What changes were proposed in this PR?

This PR fixes the issue where a failed LakeFS abort call could cause the database transaction to roll back, leaving the upload session stuck in the database. It moves the LakeFS abort call outside the database transaction in abortMultipartUpload to prevent orphaned upload sessions. The transaction now handles validation and DB cleanup, returning the necessary values (repoName, uploadId, physicalAddress) as a tuple. After the transaction commits, the LakeFS abort is called separately, so the session is always cleaned up regardless of whether LakeFS succeeds.

Any related issues, documentation, discussions?

Fixes #4196

How was this PR tested?

Manually tested

Was this PR authored or co-authored using generative AI tooling?

No

@carloea2
Copy link
Contributor

@aicam can you review this pr?

@carloea2
Copy link
Contributor

@aicam Can you review this PR?

@carloea2
Copy link
Contributor

@xuang7 can you add 1 test to simulate failure and then ensure abort is ok? Thanks

@chenlica
Copy link
Contributor

@carloea2 Please review it first (in case you haven't done so) as a contributor of the project. @aicam can review it after that as a committer.

Copy link
Contributor

@aicam aicam left a comment

Choose a reason for hiding this comment

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

LGTM

@carloea2
Copy link
Contributor

LGTM

@chenlica
Copy link
Contributor

@aicam Please merge it if you think it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multipart upload abort can leave orphaned upload sessions when LakeFS abort fails

4 participants