Update Mountpoint's semantics to enable opening a new file handle on an inode if all the existing open handles have been flushed#1704
Merged
mansi153 merged 28 commits intoawslabs:mainfrom Jan 14, 2026
Conversation
be725a3 to
214bb1b
Compare
214bb1b to
1539e0c
Compare
1539e0c to
6a1f768
Compare
6a1f768 to
ddbe59a
Compare
867336f to
617dd4e
Compare
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
008b93d to
cc230d3
Compare
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
passaro
reviewed
Jan 7, 2026
Contributor
passaro
left a comment
There was a problem hiding this comment.
Here are a few notes on the latest changes. We should add specific tests around the new lookup on open behavior (local vs remote).
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
passaro
reviewed
Jan 9, 2026
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
passaro
requested changes
Jan 13, 2026
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
passaro
reviewed
Jan 14, 2026
Contributor
passaro
left a comment
There was a problem hiding this comment.
Looks good. Only a couple of style suggestions.
Signed-off-by: Mansi Pandey <mansipnd@amazon.co.uk>
passaro
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update Mountpoint's semantics to enable opening a new file handle on an inode if all the existing open handles have been flushed.
This allows for the filesystem to not depend on a
releaserequest to complete pending (delayed) upload and cleanup the internal state of the inode within Mountpoint; alleviating situations where anopenrequest made immediately after a close(flush) request leads to a race condition between thereleasefollowing the close and the newopen, which is sometimes an issue when the upload to S3 has been delayed untilrelease.Does this change impact existing behavior?
The semantics continue to allow only one writer OR one/many readers concurrently active for a file; however, now a new handle can be opened which can override the current active handles (despite not being officially released) if all the active handles are marked "flushed".
As part of opening the new handle, Mountpoint will also attempt uploading any pending data written for the previous file handle. All the requests to the overridden handle(s) will then start to fail or be no-op.
Multiple concurrent writers or concurrent readers and writers are still not allowed.
A handle is marked "flushed" when a close/
flushis called on a file descriptor mapped to that handle. A followingread/writerequest will revert that flushed state and signify that the handle is actively in use and can not be overridden. We maintain this information at the individual handle level and also in an inode-locked map of handles.Breaking changes:
read/writewould fail withEBADF: file handle has been invalidated by a newer handle opened) or be no-op (for e.g.flush,release) if a newopenhas overridden the flushed handle(s).read/writerequest for a duplicate file descriptor on an existing (flushed) handle and multiple concurrentopenrequests, and any of them might succeed due to parallel processing of FUSE requests within Mountpoint. However, only one of them will ever succeed and there cannot be two concurrent writers or reader+writer for the inode at any point in time.openrequest for an inode might fail if the pending upload to S3 fails. This is independent of whether the file has been truncated in the secondopen.Does this change need a changelog entry? Does it require a version change?
Yes, it needs a changelog entry and update to the semantics.md. Yes it also requires a version change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).