-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
FEATURE: Introduce ContentRepositoryMaintainer
and restore projection cli commands
#5378
base: feature/4746-rework-catchup-mechanism-3
Are you sure you want to change the base?
Conversation
…Status` Like the `ProjectionSubscription` projections subscribers for projections will have an explicit state: `ProjectionSubscriptionStatus`. If its extended to allow other subscribers another status type should be introduced. replayRequired todo remove we cannot figurea that out in the status after all!
…status cannot be calculated ... and when extending the system to support multiple subscribers, we cannot know their original classification but have to use a special empty placeholder like: `DetachedSubscriptionStatus` This also makes the `$projectionStatus === null` detached case more explicit when using status.
Under consideration of the new `ProjectionSubscriptionStatus`
ContentRepositoryMaintainer
and restore cr:proje…ContentRepositoryMaintainer
and restore projection cli commands
Neos.ContentRepository.Core/Classes/Subscription/SubscriptionStatuses.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Service/ContentRepositoryMaintainer.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Service/ContentRepositoryMaintainer.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Service/ContentRepositoryMaintainer.php
Outdated
Show resolved
Hide resolved
/** | ||
* @api | ||
* @internal public API is the {@see ContentRepository::handle()} and the {@see ContentRepositoryMaintainer} | ||
*/ | ||
final class SubscriptionEngine |
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.
the ContentRepositoryMaintainer
allows us to make the subscription engine internal which is important to be able to extend it and to not expose too many concepts at first.
I mean looks nice and all, but do we really need this? |
Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php
Outdated
Show resolved
Hide resolved
reverts partially bace8ff
… event store position for debugging and status information
I fine tuned the On the other-hand #4746 (comment) explicitly defines that setup should not reactivate errored projections and not reattach detached projections as well. But thats just how the original inventors did it: Detached -> must be reactivated / or reset and then catchup (replay) Current state: Detached -> must be setup and then catchup / or replay
So i thought of this again, instead of offering |
in hindsight that well revert that setup updates the error state or detached state
…ller this allows us to keep the namings short and precise instead of introducing `cr:subscriptionreplayall` see also: https://neos-project.slack.com/archives/C04PYL8H3/p1732629147379509
skipBooting was removed via 0ac8751
only things in `SubscriptionStatusCollection` are API
…use its framework
Okay, regarding the naming discussion for the cli commands so currently in 9.0 this is the feature set:
which i am about to extend with a new command to retry projections in ERROR
the thing is do we want to continue using the projection naming here or as startet by Bastian originally use "subscription::
(actually his orignal draft was a little different and low level like this:)
and to have it all we could just remove the projection suffix, effectively reverting 3c154a0 again:
The question is for the future: will the projectionreplayall command then only replay the projections or other subscribers as well? Only replaying the projections would leave the others unactivated in which case the intention is maybe too literal. A general replay just to setup things makes sense right? After discussing this with christian we opted in for option Drölf: Keep the old
Regarding that the maintainer could just expose |
Adjustments for the subscription engine: #5321
Introduces a dedicated
ContentRepositoryMaintainer
as replacement forContentRepository::setUp
and theProjectionService
/ProjectionCatchupService
(from 01f7f8f)The
ContentRepositoryMaintainer
Set up and manage a content repository
Initialisation / Tear down
The method `setUp sets up the content repository like event store and projection database tables.
It is non-destructive.
Resetting a content repository with
prune
method will purge the event stream and reset all projection states.Staus information
The status of the content repository e.g. if a setup is required or if all subscriptions are active and their position
can be examined with two methods:
The event store status is available via
eventStoreStatus
, while the subscription status are returnedvia
subscriptionStatuses
. Further documentation inSubscriptionStatuses
.Replay / Catchup of projections
The methods
replayProjection
,replayAllProjections
andcatchupProjection
can be leveraged to interact with the projection catchup. In the happy path no interaction is necessary,
as
ContentRepository::handle()
triggers the projections after applying the events.For initialising on a new database - which contains events already - a replay will make sure that the projections
are emptied and reapply the events.
The explicit catchup of a projection is only required when adding new projections after installation, of after fixing a projection error.
Also a few naming adjustments were made to the original
ProjectionStatus
introduced via: #4846The idea was then that a projection could notice that it needs a replay, which is not possible as it would need access to the event store. Also with the subscription status the
ProjectionStatus
is more of a setup status or schema / migration statusand has been renamed toProjectionSetupStatus
.Furthermore the
ProjectionSubscriptionStatus
is now a first level concern like theProjectionSubscriber
in theSubscriptionStatusCollection
.If its extended to allow other subscribers another status type should be introduced.
And a special
DetachedSubscriptionStatus
was added as the projection setup status cannot be calculated and when extending the system to support multiple subscribers, we cannot know their original classification but have to use a special empty placeholder like:DetachedSubscriptionStatus
. This also makes the$projectionStatus === null
detached case more explicit when using status.Lastly the lately added method pruneAllWorkspacesAndContentStreamsFromEventStream has been inlined into CR Maintainer
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions