bulkload-with-version-check_v2#4087
Merged
jeremydmiller merged 1 commit intoJan 29, 2026
Merged
Conversation
Member
|
@sszakal Tests are good when I ran this locally. In between you submitting this and now, we broke up our CI to side step the timeouts. |
Member
|
This is going to be a cool feature. First new big feature for the document db side of things in ages |
This was referenced Jan 30, 2026
This was referenced Feb 8, 2026
This was referenced May 11, 2026
This was referenced May 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.
Currently Marten supports 3 bulk insert modes .
It would be great if Marten also supported an additional mode (or a separate BulkUpdate option) that integrates with IVersion optimistic concurrency.
Desired behavior:
• For each document in the batch:
• insert if it doesn’t exist
• update/overwrite only if IVersion matches the current stored version
• otherwise skip, rather than overwriting or throwing error
This would be very useful for online JSON migrations/backfills without taking the app down.
Example scenario:
• The application performs on-the-fly migrations when a document is loaded/edited after deployment.
• At the same time, a background job migrates all documents in bulk for speed.
• While processing a batch, some documents might already have been migrated/updated by the app due to live traffic.
• In this case, the bulk process should not overwrite those documents — it should skip updates when the stored IVersion has changed since the document was read.
IMPORTANT: I'm not familiar with marten internals . Its my first PR on this project and unfortunately I was not able to make the test pass on my machine even before making any changes to master branch (before the changes from this PR). I could only validate that my new tests are passing and the ones related to bulk loading
UPDATE: this overlaps a bit with #3301