#4617 PR 8: section 3a remainder + section 5 #4611 single-DB regression pin#4629
Merged
jeremydmiller merged 1 commit intoJun 3, 2026
Conversation
…on pin Three new files, 7 tests covering #4617 section 3a remaining items (return-shape coverage, event-metadata propagation) plus the single-DB conjoined variant of the #4611 regression already pinned for sharded. ## 3a — Return-shape coverage (`AppendWrite/append_return_shapes_under_partitioning.cs`, 3 tests) The Append + StartStream overload matrix has multiple shapes (`params object[]`, `IEnumerable<object>`, single-event-via-params-of-one). Each must route through the bulk `mt_quick_append_events` function and land in the owning tenant's partition. Pinned per the spec's "Return shapes" item so a future overload-resolution change or appender refactor can't silently reshape what hits the partitioned tables. - `append_via_params_object_array_lands_in_tenants_partition` - `append_via_IEnumerable_lands_in_tenants_partition` - `append_single_event_via_params_array_of_one_lands_in_tenants_partition` (single-event boundary case — the loop bound at array_length(event_ids, 1)) ## 3a — Event metadata propagation (`AppendWrite/event_metadata_propagation_under_partitioning.cs`, 2 tests) Per the spec's TenantPropagation pin (#4424) and metadata-flow pin: - `event_TenantId_equals_stream_TenantId_under_partitioning` — shared fixture; pins the TenantPropagation invariant that every event's `TenantId` equals the stream's tenant, never null. - `event_optional_metadata_propagation_under_partitioning` — its own DocumentStore because CorrelationId / CausationId / Headers / UserName metadata columns are opt-in (MetadataConfig.* = true). Pins that the full set propagates from session → each event in the bulk batch, AND that TenantId stays paired with the right tenant alongside the opt-in metadata. ## Section 5 — #4611 single-DB regression pin (`Regressions/Bug_4611_mandatory_stream_type_under_partitioning.cs`, 2 tests) The sharded variant already lives in `Sharded/sharded_tenancy_per_tenant_events.cs` from PR #3. This is the single-DB conjoined variant the spec specifically calls out as missing. Own-store because UseMandatoryStreamTypeDeclaration is a store-wide flag. - `StartStream_with_aggregate_type_followed_by_Append_works` — Start + Append both succeed; mt_streams row exists with `type` = aggregate alias. - `untyped_StartStream_still_throws_StreamTypeMissingException` — companion pin: the API-level guard in EventStore.StartStream STILL fires synchronously for the no-type overload. PR #4613's fix didn't (and shouldn't) weaken this guard. ## Verified - **net9.0**: 118/118 pass (was 111 → +7) - **net10.0**: 118/118 pass ## Subsequent PRs per the #4617 checklist - 3c remaining: EventProjection, FlatTableProjection, MultiStreamProjection RollUpByTenant + AcrossTenants / AddGlobalProjection, custom IAggregateGrouper + fan-out, raw IProjection, same-projection lifecycle equivalence. - 3d remaining: AddMartenManagedTenantsAsync(Guid[]) N-format pin, sharded reuses ONE MartenDatabase per shard, IDynamicTenantSource lifecycle. - 3e remaining: DeleteAllTenantDataAsync orphan-sequence leak pin (needs own-store), RemoveMartenManagedTenantsAsync, AssertDatabaseMatchesConfigurationAsync drift, DDL generation, PerTenantEventSequences schema-object correctness, AutoCreate matrix. - 3f DCB partitioned coverage. - Section 4 daemon in-depth. - Section 5 remaining: 42P01 / 42P16 / 42P07 / MT002-rebuild regression families. - 3a remaining: Quick vs QuickWithServerTimestamps timestamp-source pin, seq_id gap-after-failed-batch. - 3b deferred items. 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.
Eighth #4617 slice — 7 new tests across three files, covering section 3a remaining items + the single-DB conjoined variant of the #4611 regression already pinned for sharded.
3a — Return-shape coverage (3 tests)
AppendWrite/append_return_shapes_under_partitioning.csThe Append + StartStream overload matrix has multiple shapes (
params object[],IEnumerable<object>, single-event-via-params-of-one). Each must route through the bulkmt_quick_append_eventsfunction and land in the owning tenant's partition. Pinned per the spec's "Return shapes" item so a future overload-resolution change or appender refactor can't silently reshape what hits the partitioned tables.append_via_params_object_array_lands_in_tenants_partitionappend_via_IEnumerable_lands_in_tenants_partitionappend_single_event_via_params_array_of_one_lands_in_tenants_partition(boundary case)3a — Event-metadata propagation (2 tests)
AppendWrite/event_metadata_propagation_under_partitioning.csPer the spec's TenantPropagation pin (#4424) and metadata-flow pin:
event_TenantId_equals_stream_TenantId_under_partitioning— shared fixture; pins the TenantPropagation invariant that every event'sTenantIdequals the stream's tenant, never null.event_optional_metadata_propagation_under_partitioning— own DocumentStore because CorrelationId / CausationId / Headers / UserName columns are opt-in (MetadataConfig.* = true). Pins that all four propagate from session → each event in the bulk batch, AND that TenantId stays paired with the right tenant alongside the opt-in metadata.Section 5 — #4611 single-DB regression pin (2 tests)
Regressions/Bug_4611_mandatory_stream_type_under_partitioning.csThe sharded variant already lives in
Sharded/sharded_tenancy_per_tenant_events.csfrom PR #3. This is the single-DB conjoined variant the spec specifically calls out as missing. Own-store becauseUseMandatoryStreamTypeDeclarationis a store-wide flag.StartStream_with_aggregate_type_followed_by_Append_works— Start + Append both succeed;mt_streamsrow exists withtype= aggregate alias (the headline StartStream doesn't create mt_streams row under per-tenant event partitioning (sharded) → NonExistentStream on later append (9.5.0) #4611 surface).untyped_StartStream_still_throws_StreamTypeMissingException— companion pin: the API-level guard inEventStore.StartStreamSTILL fires synchronously for the no-type overload. PR Fix #4611: allow StartStream with mandatory stream types under per-tenant event partitioning #4613's fix didn't (and shouldn't) weaken this guard.Verified
TenantPartitionedEventsTestsnet9.0TenantPartitionedEventsTestsnet10.0Subsequent PRs per the #4617 checklist
RollUpByTenant+AcrossTenants, customIAggregateGrouper, rawIProjection, lifecycle equivalenceAddMartenManagedTenantsAsync(Guid[])N-format pin, sharded one-DB-per-shard,IDynamicTenantSourcelifecycleDeleteAllTenantDataAsyncorphan-sequence leak pin,RemoveMartenManagedTenantsAsync,AssertDatabaseMatchesConfigurationAsyncdrift, DDL generation,PerTenantEventSequencesschema-object correctness, AutoCreate matrix🤖 Generated with Claude Code