-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: Migration to correct order of removed node events #5363
BUGFIX: Migration to correct order of removed node events #5363
Conversation
As discussed with Denny, Christian, Sebastian, Bastian and others this is wrong in the sense of event sourcing as the history is changed but the best solution we have. Lets merge it and have it for beta 16! |
Aye, reordering is bad, then again the events never should have happened in the previous order in the first place. So this is actually correcting history. |
$this->connection->executeStatement( | ||
'DELETE FROM ' . $eventTableName . ' WHERE sequencenumber IN (:sequenceNumbers)', | ||
[ | ||
'sequenceNumbers' => array_map(fn (EventEnvelope $eventEnvelope) => $eventEnvelope->sequenceNumber->value, $eventsToReorder) |
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.
can these delete from and below the commit
statements get tooo large? I tested it with 800 events to delete and publish at once and that worked.
Worked for my project, so +1 |
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.
works for me
We found out that there is a catch after all. Its is not correct for every case to move the removal to the end.
the remove node MUST be in the middle position. Otherwise there will be a duplicate node entry in the content graph because we dont have constraints, and the document uri path constraint This is not a problem with user generated content but for imports with deterministic node aggregate ids (which have been deleted and recreated) this will fail. |
Resolves partially: #5364 a replay from previous betas works again
Resolves: #5352 by fixing the replay allowing users to upgrade to beta 15
Upgrade instructions
Review instructions
The idea to solve the replay for both cases (when structured nodes were repaired, and when a node was moved after deletion) we could just reorder all the
NodeAggregateWasRemoved
events to the end.I tested that replaying works again for both bugs.
The only downside is that the removed nodes would temporarily reappear in every workspace as they are now outdated and have to be rebased. But that can be automated as well :)
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions