-
-
Notifications
You must be signed in to change notification settings - Fork 221
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 4508 mark dependands of live outdated after direct change #5274
base: 9.0
Are you sure you want to change the base?
BUGFIX 4508 mark dependands of live outdated after direct change #5274
Conversation
Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
Show resolved
Hide resolved
@@ -56,11 +55,13 @@ public function findWorkspaceByName(WorkspaceName $workspaceName): ?Workspace | |||
{ | |||
$workspaceByNameStatement = <<<SQL | |||
SELECT |
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.
should we deduplicate this logic using a querybuilder?
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.
I don't think so
{$this->tableNames->workspace()} ws | ||
JOIN {$this->tableNames->contentStream()} cs ON cs.id = ws.currentcontentstreamid | ||
LEFT JOIN {$this->tableNames->contentStream()} scs ON cs.sourceContentStreamId = scs.id |
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.
so the performance trait is this: we still have the status in the workspace, but we have to calculate it slightly more expensive with these two joins.
I cannot say if this is better performance than having on the write side a similar complex update logic for each event. But as findWorkspaceByName
(and implicitly getContentGraph
) trigger this query and are also part of the write side for constraint checks we have to carefully evaluate.
....ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/WorkspaceState.feature
Show resolved
Hide resolved
c374314
to
db7861f
Compare
…known source version
... and refactor status calculation logic. By leveraging `isSatisfiedBy` i found out the `>` comparison was not quite correct. We should use `===`.
f928255
to
26e2de7
Compare
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.
Looks great already, just a comment regarding "expected version"
....ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/WorkspaceState.feature
Show resolved
Hide resolved
$expectedSourceVersion = ExpectedVersion::fromVersion(Version::fromInteger($row['expectedSourceVersion'])); | ||
|
||
if (!$expectedSourceVersion->isSatisfiedBy($sourceVersion)) { | ||
$status = WorkspaceStatus::OUTDATED; | ||
} |
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.
Mostly a naming thing, but the "expected version" is something for the write side, i.e. I trigger a command and I expect the model to be of a given version.
In this case it is just two versions of content streams.
Neos.ContentGraph.DoctrineDbalAdapter/src/ContentRepositoryReadModelAdapter.php
Outdated
Show resolved
Hide resolved
@@ -55,11 +57,13 @@ public function findWorkspaceByName(WorkspaceName $workspaceName): ?Workspace | |||
{ | |||
$workspaceByNameStatement = <<<SQL | |||
SELECT | |||
name, baseWorkspaceName, currentContentStreamId, status | |||
ws.name, ws.baseWorkspaceName, ws.currentContentStreamId, cs.sourceContentStreamVersion as expectedSourceVersion, scs.version as sourceVersion |
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: Maybe we can simplify this to sth like:
ws.name, ws.baseWorkspaceName, ws.currentContentStreamId, cs.sourceContentStreamVersion as expectedSourceVersion, scs.version as sourceVersion | |
ws.name, ws.baseWorkspaceName, ws.currentContentStreamId, cs.sourceContentStreamVersion = scs.version as isUpToDate |
…dands-of-live-outdated-after-direct-change
…oid fetching full workspace model with the extra joins in the workspace model it is just easier to just select the current content stream id directly
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.
Looks nice
FIXES: #4508
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions