Repository navigation
Reset composite members' per-tenant progression before a per-tenant rebuild - #5829
Merged
Merged
Conversation
…ebuild DeleteProjectionProgressAsync(database, name, tenantId) tore down every composite member's tenant documents but deleted only the composite's own per-tenant progression row. Once the members had progressed (any continuous run), the rebuild's first batch inserted every member's progression from the floor and failed on pk_mt_event_progression, pausing the shard with nothing rebuilt. The store-global teardown already drops each leaf's rows; the per-tenant reset now does the same for the tenant's rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
Merged
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.
Problem
DeleteProjectionProgressAsync(database, name, tenantId)is the reset a per-tenant rebuild runs first. For a composite, it tore down every member's tenant documents but deleted only the composite's own per-tenant progression row.Once the members had progressed (any continuous run), the rebuild's first batch inserted every member's progression from the floor and failed on
pk_mt_event_progression. The shard paused with nothing rebuilt:This is reachable today through
RebuildProjectionAsync(composite, tenantId, ...). JasperFx/jasperfx#1128 makes every store-wide rebuild fan out per tenant underUseTenantPartitionedEvents, because the store-global replay was silently dropping events there. With that change, every store-wide composite rebuild on a partitioned store would hit this, so this should land before or with the JasperFx pin bump.Change
The tenant-scoped reset now deletes the tenant's progression row for every leaf's shards as well as the composite's own, matching what the store-global
teardownProjectionStoragealready does per leaf.Tests
per_tenant_composite_rebuild_after_progress: two tenants, a two-stage composite, a continuous run, then a per-tenant rebuild of one tenant. On the current JasperFx 2.98.0 pin it fails without the change (the rebuilt tenant has no documents) and passes with it.Once #1128 ships, the pin bump should also add a store-wide rebuild regression test: a composite with
BatchSize = 10over 6 tenants, which loses events on 2.98.0.🤖 Generated with Claude Code