DRIVERS-3618 Require deleting orphaned GridFS file chunks - #1979
Draft
GromNaN wants to merge 3 commits into
Draft
Conversation
Deleting a GridFS file now always deletes the chunks with the given files_id, even when no files collection document was deleted, so orphaned chunks are removed. Whether the file existed is determined from the delete result on the files collection, not from a separate query.
GromNaN
marked this pull request as draft
September 1, 2026 21:42
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.
https://jira.mongodb.org/browse/DRIVERS-3618
Deleting a GridFS file by id now always deletes the chunks with the given
files_id, even when no files collection document was deleted. This removes orphaned chunks instead of leaving them in the bucket, which was previously optional (MAY).The spec also now requires drivers to use the number of deleted documents reported by the delete command on the files collection to decide whether the file existed, instead of running a separate query.
Please complete the following before merging: