Account for pending XFTP files in storage quota - #1869
Open
spencer-michaels-1pw wants to merge 2 commits into
Open
Account for pending XFTP files in storage quota#1869spencer-michaels-1pw wants to merge 2 commits into
spencer-michaels-1pw wants to merge 2 commits into
Conversation
spencer-michaels-1pw
requested review from
epoberezkin and
spaced4ndy
as code owners
September 12, 2026 04:31
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.
Summary
PR #1814 changed startup storage accounting to count only files that had completed upload. As a result, pending file records created by
FNEWcurrently don't consume the configured storage quota, even though those records remain in the file store and are even restored after a restart.This fix reserves the advertised size for each file record before it is created and keeps the reservation in place while the file is either pending, uploaded, or blocked; reservations are only released upon deletion. After a restart, reservations are reconstructed from the stored records. In addition, the deletion APIs now return the amount of reserved space to release, ensuring that repeated or overlapping deletion attempts cannot release it more than once.
A record's quota is released only after the record is successfully removed from the store. Deletion returns the deleted file’s size only when it actually removes the record, so repeated or concurrent deletion attempts cannot release the same quota twice. The quota arithmetic also rejects overflow and underflow to ensure that the counter remains valid.
Tests added
FNEWcreates pending records