-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Rework CatchUp mechanism #4746
Comments
Thanks for the write-up! I didn't think your suggestion through yet, but wanted to leave one thought already. Using the fork-approach might be tricky, as I assume that most hosting providers will now have the pctnl extension enabled. So, if that's a hard requirements, people will have trouble using Neos in at a vanilla hosting provider. |
Funnily we do have it :D But yes, this is a separate issue and in the end doesn't really fix much for now, so we can probably think about it later. |
From todays Weekly:
|
Note: I updated the suggested architecture in the issue description: SubscriberThe actual event handler – in our case basically a closure around SubscriptionThe persisted state of a subscriber with
A subscription is basically a state machine with the states
But we can probably simplify it to something like: Subscription EngineThe central authority to manage subscription states and invoke subscribers.
For reference:The original implementation: https://github.com/patchlevel/event-sourcing/blob/3.4.x/src/Subscription/Engine/DefaultSubscriptionEngine.php and a WIP version of that from me: https://github.com/bwaidelich/dcb-library/blob/main/src/Subscription/Engine/SubscriptionEngine.php (IMO a bit easier to read but the DB lock is not nice yet) |
The
CatchUp
mechanism was overhauled with #4289 but the current implementation still has some issues:By default we use
Scripts::executeCommandAsync()
(using the SubprocessProjectionCatchUpTrigger) to trigger catch ups.This can lead to many sub requests if there are a lot of commands (e.g. multiple editors creating content simultaneously).
Apart from the eminent performance issue this can bring, those sub requests might be killed if the parent request ends (or due to process limits).
Update: After going back and forth I now suggest:
ContentRepository::handle()
will always be blocking until all projections are up to dateEventPersister
will simply triggerProjectionInterface::apply()
for every new published eventConsiderations
ProjectionCatchUpTriggerInterface
could interact with a background worker (e.g. via socket) but the catch up would still be blockingContentRepository::handleAsync()
later if we find that we really need it (but my feeling is that this only makes sense when we introduce a proper write side model for constraint checks etc)Current architecture
Suggested architecture
The original ideas I wrote down in November 2023 when creating this issue:
Related: #4388
The text was updated successfully, but these errors were encountered: