Marten#4493 regression test on master (no code fix needed)#4497
Merged
Conversation
Companion to the 8.0-line fix in #4496. The bug — NullReferenceException when combining .UseOptimisticConcurrency(true) with AllDocumentsAreMultiTenantedWithPartitioning(...) — doesn't reproduce on master because the offending code path (Marten/Storage/UpsertFunction.cs) was retired in #4461's closed-shape storage rewrite. The cherry-pick of the 8.0 patch therefore omits the UpsertFunction.cs edit (file no longer exists) and lands only the regression test. Test exercises the exact configuration shape from the reporter's repro: .UseOptimisticConcurrency(true) on a document plus AllDocumentsAreMultiTenantedWithPartitioning with two list partitions, then applies the schema and round-trips a document through one of the partitions. Acts as a regression-prevention guard against any future change that re-introduces a similar null-traversal in the partition-aware DDL generation. Passes on net9.0 / net10.0. Closes #4493. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes #4493. Companion to the 8.0-line fix in #4496.
The bug —
NullReferenceExceptionwhen combining.UseOptimisticConcurrency(true)withAllDocumentsAreMultiTenantedWithPartitioning(...)— was inMarten/Storage/UpsertFunction.cs. That file was retired entirely on master by #4461's closed-shape storage rewrite ("Boom"), so the bug doesn't reproduce here. The cherry-pick of the 8.0 patch therefore omits theUpsertFunction.csedit (file no longer exists on master) and lands only the regression test.Why land just the test
Test plan
CoreTests/Partitioning/Bug_4493_optimistic_partitioning.csexercises the exact configuration shape from the reporter's repro:.UseOptimisticConcurrency(true)on a document plusAllDocumentsAreMultiTenantedWithPartitioningwith two list partitions, then applies the schema and round-trips a document through one of the partitions.NullReferenceExceptionwithout theUpsertFunction.csfix — confirmed in Fix #4493: NullReferenceException combining optimistic concurrency and partitioning #4496.🤖 Generated with Claude Code