Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 4049616 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
rkistner
marked this pull request as ready for review
October 29, 2026 08:27
This comment was marked as resolved.
This comment was marked as resolved.
This branch has not been deployed
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.
For MongoDB Storage v4 compacting, we have two types of compact process, picked per bucket:
Both of them have an optimization to not re-write any chunk if it did not change. It could change either when merging multiple chunks into one larger one, and/or replacing operations with tombstones.
This now adds an exception to that rule: If the chunk exceeds the object storage threshold (16KiB by default), but is still stored inline, it is now moved to object storage. Since the logic is already there to re-write chunks, this is a simple change to exclude this case from skipping the chunk.
This specifically helps for the case of an instance that is already using storage version 4, but did not have object storage enabled yet. This will effectively move the data over to object storage as buckets are compacted, without requiring full reprocessing.
I expect this to only have a minor effect on chunk-merge compact: Since it primarily scans new chunks, those should already be on object storage if object storage is enabled. This nonetheless enables the check for chunk-merge compact. But for a full compact, the entire bucket would be scanned and moved.
This would still have no effect if a bucket doesn't receive any changes. But even a single new operation on a bucket would eventually trigger a full compact.
This can also move existing chunks when the inline threshold is decreased, if they change to now being above the threshold.
AI Usage
Implemented using gpt-6.1-sol; manually reviewed.