-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Archiving a stream in the same transaction as appending events to it leaves stream events unarchived #2982
Comments
Isn't this intended?
this results in This allows us to rerun projection that have to delete data for the hard delete event. Once a day we cleanup archived streams from the database. |
@Xzelsius There's a switch on most of the built in projections to utilize archived events in rebuilds. You shouldn't use it willy nilly, but it's there |
@AtomYcX I'm going to address this by adding documentation to the effect that, yes, this is legal. @Xzelsius talked this over with me off to the side, and there is a valid use case for doing this. Maybe there could be a separate action for "archive all new events too"? But also, what was your use case? Why did you both append and try to archive at the same time? |
Hi @jeremydmiller, Our use case aligns with what @Xzelsius described above about "hard deleting" a stream. Think the 1st question of #3258 more accurately describes our problem. Happy to close this in favor of it. |
When a stream fetched using optimistic concurrency via
FetchForWriting<T>
is archived usingIDocumentSession.Events.ArchiveStream()
any events that have been appended in the same transaction prior to callingArchiveStream()
remain withis_archived = false
in themt_events
table, even though the stream itself is marked as archived inmt_streams
.Reproduction steps:
IDocumentSession.Events.FetchForWriting<T>
IEventStream<T>.AppendMany
IDocumentSession.Events.ArchiveStream
IDocumentSession.SaveChangesAsync
The text was updated successfully, but these errors were encountered: