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
WIP: Replace CatchUpHooks
with ContentRepositoryHooks
#4995
base: feature/4746-rework-catchup-mechanism
Are you sure you want to change the base?
WIP: Replace CatchUpHooks
with ContentRepositoryHooks
#4995
Conversation
Resolves: #4992
CatchUpHooks
with ContentRepositoryHooks
…2-rework-catch-up-hooks
…2-rework-catch-up-hooks
$lock->release(); | ||
} | ||
|
||
/** | ||
* NOTE: This will NOT trigger hooks! | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to CatchUpService?
Neos.ContentRepository.Core/Classes/EventStore/EventPersister.php
Outdated
Show resolved
Hide resolved
foreach ($this->projections as $projection) { | ||
if (!$projection->getCheckpoint()->equals($expectedCheckpoint)) { | ||
//throw new \RuntimeException(sprintf('Projection %s is at checkpoint %d, but was expected to be at %d', $projection::class, $projection->getCheckpoint()->value, $expectedCheckpoint->value), 1714062281); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @skurfuerst :
No reason to "stop the world" here, but we should add some result object that contains the projections that were updated/skipped such that we can inform the user immediately
$event = $this->eventNormalizer->denormalize($eventEnvelope->event); | ||
$hooks->dispatchBeforeEvent($event, $eventEnvelope); | ||
foreach ($projectionsToUpdate as $projection) { | ||
$projection->apply($event, $eventEnvelope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: try/catch
-> collect exceptions and throw one combined exception after releasing the lock in line 85
…2-rework-catch-up-hooks
…2-rework-catch-up-hooks
…om/neos/neos-development-collection into feature/4992-rework-catch-up-hooks
$contentRepository->catchUpProjections(); | ||
|
||
$hooks->dispatchBeforeCatchUp(); | ||
foreach ($this->eventStore->load($eventsToPublish->streamName)->withMinimumSequenceNumber($expectedCheckpoint->next()) as $eventEnvelope) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might read more events than were published..
I think we also need to specify the max sequence number!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think it's correct this way. But it means that a newly published event might haven been applied in a separate process already
Resolves: #4992
WIP because