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

Sequent::Core::Persistors::ActiveRecordPersistor fails when record has belongs_to while replaying #365

Open
lvonk opened this issue Jan 19, 2023 · 0 comments

Comments

@lvonk
Copy link
Member

lvonk commented Jan 19, 2023

Out of the box Sequent uses the Sequent::Core::Persistors::ActiveRecordPersistor for replaying events on a Sequent
migration. When a record has a belongs_to it expects the "parent" record to exist. During replay this is not guaranteed since
the default replay strategy replays on aggregate_id.
Although we don't expect any validations on projections (records) they should probably be skipped explicitly nonetheless, my guess is that would skip the belongs_to check as well.
As work around, and recommendation, you should configure Sequent to use the Sequent::Core::Persistors::ReplayOptimizedPostgresPersistor during replay.

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

No branches or pull requests

1 participant