-
-
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
FEATURE: Introduce ContentRepositoryMaintainer
and restore projection cli commands
#5378
FEATURE: Introduce ContentRepositoryMaintainer
and restore projection cli commands
#5378
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 |
fd768da
into
neos:feature/4746-rework-catchup-mechanism-3
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 subscription database tables.It is non-destructive.
Resetting a content repository with
prune
method will purge the event stream and reset all subscription states.Status 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
status
The event store status is available via
ContentRepositoryStatus::$eventStoreStatus
, and the subscription statusvia
ContentRepositoryStatus::$subscriptionStatus
. Further documentation inSubscriptionStatusCollection
.Subscriptions (mainly projections)
This maintainer offers also the public API to interact with the subscription catchup. In the happy path,
no interaction is necessary, as
ContentRepository::handle()
triggers the subscriptions after applying the events.Special cases:
Replay
For initialising on a new database - which contains events already - a replay will make sure that the subscriptions
are emptied and reapply the events. This can be triggered via
replaySubscription
orreplayAllSubscriptions
And after registering a new subscription a setup as well as a replay of this subscription is also required.
Reactivate
In case a subscription is detached but is reinstalled a reactivation is needed via
reactivateSubscription
Also in case a subscription runs into the error status, its code needs to be fixed, and it can also be attempted to be reactivated.
Note that in both cases a subscription replay would also work, but with the difference that the subscription is reset as well.
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