Skip to content
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

Draft
wants to merge 4 commits into
base: task/add-workspace-contentstream-mapping-to-contentgraph
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

FIXES: #4508

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@@ -754,8 +753,6 @@ private function whenWorkspaceWasCreated(WorkspaceWasCreated $event): void
private function whenWorkspaceWasDiscarded(WorkspaceWasDiscarded $event): void
{
$this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId);
$this->markWorkspaceAsOutdated($event->workspaceName);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this markWorkspaceAsOutdated in discard seems to have been wrong. At least i makes no sense because we get a fresh cs.

@@ -56,11 +55,13 @@ public function findWorkspaceByName(WorkspaceName $workspaceName): ?Workspace
{
$workspaceByNameStatement = <<<SQL
SELECT
Copy link
Member Author

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?

Comment on lines +60 to +62
{$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
Copy link
Member Author

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.

| baseWorkspaceName | "shared" |
| newContentStreamId | "user-cs-two" |

Scenario: Changes to the root workspace render dependents outdated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tests fails on 9.0-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant