You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A partial publish results in events annotated for "live" workspace yet are not in the "live" content stream.
This is due to a fork of the live content stream being created with the partially published events in, which is then published to the actual live content stream.
This leaves behind duplicate events both containing "workspaceName: live" yet only one of them is in the live content stream. A catchup or replay will fail however due to duplicate database entries for the projections relying on anything with "workspaceName: live" being actually in the live content stream.
The pr #5293 provides a test which fails showing the behaviour.
This bug was introduced with the introduction of workspace names in events #5002, which happened some time ago but with the merge and release of #5149 we actually started relying on the new workspace name also which lead to this bug.
Properly solving it should also allow catchup hooks to not implement hacks as such to skip events:
// Safeguard for temporary content streams created during partial publish -> We want to skip these events, because their workspace doesn't match current content stream.
if (!$contentGraph->getContentStreamId()->equals($eventInstance->getContentStreamId())) {
return;
}
}
solutions
We discussed a lot of options for solving the bug here and here as well as countless hours on the Dresden sprint and we investigated into a few directions:
1.) Dont lie by using real temporary workspaces
Create a new "real" workspace on the fly, to simulate virtual workspaces (hacky and defeats the purpose of workspaces a litte) -> #5293
2.) Lie and introduce some kind of virtual workspace names
Introduce virtual workspace names and use union everywhere WorkspaceName|VirtualWorkspaceName -> #5302
This was also discussed as a "light" approach as how it was once proposed by tracking the "virtual" state in the actual WorkspaceName directly and "asking" if its virtual: WorkspaceName::isVirtual() like #5167
Or by using a TemporaryWorkspaceName builder or something from the outside, which would conflict if users could use the same prefix for actual workspace names as we wouldnt be able to surely detect that (detecting it is required so catchups dont run rogue:)):
We were again really close to giving in the temptation to introduce VirtualWorkspaceName but as we could avoid that 2 or 3 times because the complexity is really high:
virtual workspace names must be allowed everywhere in the core, like the content graph and node read model
but carefully disabled in other places, e.g. the NodeAddress used for routing must NOT allow direct access on any stream
security is harder to implement - or impossible - if nodes can be access through virtual names
catchup hooks have to skip virtual nodes as they are still persisted in the events
3.) Dont lie by not persisting the events during the rebase attempt and only forward it to the main projection which will be rollbacked (simulated publishing)
while discussing options the idea came up here to just not emit events during the rebase to the catchups, at first the solution was just an in memory event store and doing an additional fork in the database and then clean it up again, but with a lot of thought we basically created a new way of publishing leveraging a transaction and rollback to even safe a lot of unnecessary expensive forking:
A partial publish results in events annotated for "live" workspace yet are not in the "live" content stream.
This is due to a fork of the live content stream being created with the partially published events in, which is then published to the actual live content stream.
This leaves behind duplicate events both containing "workspaceName: live" yet only one of them is in the live content stream. A catchup or replay will fail however due to duplicate database entries for the projections relying on anything with "workspaceName: live" being actually in the live content stream.
The pr #5293 provides a test which fails showing the behaviour.
This bug was introduced with the introduction of workspace names in events #5002, which happened some time ago but with the merge and release of #5149 we actually started relying on the new workspace name also which lead to this bug.
Properly solving it should also allow catchup hooks to not implement hacks as such to skip events:
neos-development-collection/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php
Lines 51 to 60 in b11026d
solutions
We discussed a lot of options for solving the bug here and here as well as countless hours on the Dresden sprint and we investigated into a few directions:
1.) Dont lie by using real temporary workspaces
Create a new "real" workspace on the fly, to simulate virtual workspaces (hacky and defeats the purpose of workspaces a litte) -> #5293
2.) Lie and introduce some kind of virtual workspace names
Introduce virtual workspace names and use union everywhere
WorkspaceName|VirtualWorkspaceName
-> #5302This was also discussed as a "light" approach as how it was once proposed by tracking the "virtual" state in the actual
WorkspaceName
directly and "asking" if its virtual:WorkspaceName::isVirtual()
like #5167Or by using a
TemporaryWorkspaceName
builder or something from the outside, which would conflict if users could use the same prefix for actual workspace names as we wouldnt be able to surely detect that (detecting it is required so catchups dont run rogue:)):We were again really close to giving in the temptation to introduce
VirtualWorkspaceName
but as we could avoid that 2 or 3 times because the complexity is really high:NodeAddress
used for routing must NOT allow direct access on any stream3.) Dont lie by not persisting the events during the rebase attempt and only forward it to the main projection which will be rollbacked (simulated publishing)
while discussing options the idea came up here to just not emit events during the rebase to the catchups, at first the solution was just an in memory event store and doing an additional fork in the database and then clean it up again, but with a lot of thought we basically created a new way of publishing leveraging a transaction and rollback to even safe a lot of unnecessary expensive forking:
Publishing Version 3 -> #5301
The text was updated successfully, but these errors were encountered: