Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set DeadLetterEvent as single tenanted for conjoined tenancy #2690

Merged
merged 6 commits into from
Sep 8, 2023

Conversation

oskardudycz
Copy link
Collaborator

@oskardudycz oskardudycz commented Aug 23, 2023

Fixes #2686.

Set DeadLetterEvent as single tenanted for conjoined tenancy. A dead letter event represents an event skipped for the particular projection. It references that event at a specific global event store sequence. Thus, it has to be global and does not have a tenant. If we rebuild the projection, all read models will be rebuilt using events from all tenants.

Added test ensuring that conjoined tenancy is handled correctly.

Enhanced ProjectionUpdateBatch disposal. There could be a race condition when the session was released, but the processing Queue wasn't completed, which caused the session to be null. Added nullable annotations to make that explicit and fixes accordingly (by checking the cancellation token and implementing disposal consistently).

@BrettGFleischer @jeremydmiller FYI

@oskardudycz oskardudycz force-pushed the bug/2686-rebuild_conjoined branch 2 times, most recently from 0a7853a to bacd7bb Compare August 29, 2023 11:29
There could be a race condition when session was released, but Queue wasn't completed that caused session to be null. Added nullable annotations to remove the chance of that to appear.
@oskardudycz oskardudycz marked this pull request as ready for review August 29, 2023 16:42
…ltitenancy for it

DeadLetterEvent references the event with specific sequence. It's always global, and there's no option to replay events for a specific tenant for conjoined tenancy.
@oskardudycz oskardudycz changed the title Added failing test for bug #2686 showing wrong handling of the skipped DeadLetterEvents Set DeadLetterEvent as single tenanted for conjoined tenancy Aug 30, 2023
@oskardudycz oskardudycz merged commit 97b5072 into master Sep 8, 2023
13 checks passed
@oskardudycz oskardudycz deleted the bug/2686-rebuild_conjoined branch September 8, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BuildProjectionDaemonAsync Does Not Use The "tenantIdOrDatabaseIdentifier" Correctly
1 participant