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

Consistency level in projector and store #122

Merged
merged 5 commits into from
Oct 10, 2022

Conversation

cottinisimone
Copy link
Contributor

@cottinisimone cottinisimone commented Oct 10, 2022

Closes: #82

matteosister
matteosister previously approved these changes Oct 10, 2022
@cottinisimone cottinisimone merged commit 88ffbd3 into master Oct 10, 2022
@cottinisimone cottinisimone deleted the consistency_level_in_projector_and_store branch October 10, 2022 10:40
@emturner
Copy link
Contributor

Hi @cottinisimone! Hope you're well 😄

I think that possibly, while this address #82, the implementation is misleading?

Regardless of whether consistency is set to strong or weak, the projectors are still running to completion within the transaction -
The only difference here, is whether projectors are 'allowed' to fail? So while this does allow you to 'opt in' to allowing projectors to fail, I think the notion of 'consistency' here is perhaps misleading?

Perhaps if consistency is weak, all the projectors should be run separately, in an ideal world? @matteosister
But possibly this is more effort, as could require larger restructuring of the crate?

(If a projector panics, for any reason, then clearly the event doesn't get persisted at all, but maybe that's not an issue).

@cottinisimone
Copy link
Contributor Author

cottinisimone commented Oct 10, 2022

Hi @cottinisimone! Hope you're well smile

I think that possibly, while this address #82, the implementation is misleading?

Regardless of whether consistency is set to strong or weak, the projectors are still running to completion within the transaction - The only difference here, is whether projectors are 'allowed' to fail? So while this does allow you to 'opt in' to allowing projectors to fail, I think the notion of 'consistency' here is perhaps misleading?

Perhaps if consistency is weak, all the projectors should be run separately, in an ideal world? @matteosister But possibly this is more effort, as could require larger restructuring of the crate?

(If a projector panics, for any reason, then clearly the event doesn't get persisted at all, but maybe that's not an issue).

Ops. I've already merged. So what could be a better name for this? Failability? Fallibility? Don't know honestly

@emturner
Copy link
Contributor

emturner commented Oct 10, 2022

Don't worry! My fault for being a bit slow responding to github notifications 😆

I am also not sure - perhaps something like:

/// Governs the relationship of an event to a resulting projection.
pub enum ParentEventRelationship {
   ///  This projector must succeed, for the parent event to be persisted.
   Blocking,
   /// This projector is allowed to fail, and doesn't block persisting the parent event.
   Fallible
}

Though I'm not sold on this enum name either!

@cottinisimone
Copy link
Contributor Author

I open an issue for that in order to discuss about that. Thank you very much Emma :)

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.

an error in a projector results in the event not being persisted
4 participants