Skip to content

fix(server): restore snapshots for large instance histories - #6004

Merged
SteKoe merged 1 commit into
codecentric:masterfrom
Aminark:fix/restore-large-instance-snapshots
Nov 28, 2026
Merged

SteKoe merged 1 commit into
codecentric:masterfrom
Aminark:fix/restore-large-instance-snapshots

Conversation

@Aminark

@Aminark Aminark commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

On startup the snapshot repository groups stored events by instance and sorts each group by version. A group can only emit once the history ends. With enough distinct instances, the default flatMap concurrency leaves groups unsubscribed and the history publisher stops making progress. The repository can appear empty and never switch to live events.

Subscribe to every group during replay, keeping the existing version ordering within each instance. The regression test starts with 1,024 distinct registrations, verifies all 1,024 snapshots, then saves a new registration and verifies that the live subscription updates its snapshot. Before the change the same test found zero snapshots.

@Aminark
Aminark requested a review from a team as a code owner November 27, 2026 17:04
@SteKoe
SteKoe merged commit 3e91f85 into codecentric:master Nov 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants