Skip to content

DRIVERS-3618 Require deleting orphaned GridFS file chunks - #1979

Draft
GromNaN wants to merge 3 commits into
mongodb:masterfrom
GromNaN:DRIVERS-3618
Draft

DRIVERS-3618 Require deleting orphaned GridFS file chunks#1979
GromNaN wants to merge 3 commits into
mongodb:masterfrom
GromNaN:DRIVERS-3618

Conversation

@GromNaN

@GromNaN GromNaN commented Sep 1, 2026

Copy link
Copy Markdown
Member

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:

  • Is the relevant DRIVERS ticket in the PR title?
  • Update changelog.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, and sharded clusters).

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
GromNaN requested a review from a team as a code owner September 1, 2026 21:25
@GromNaN
GromNaN marked this pull request as draft September 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant