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

WIP: FEATURE: Rework CR CatchUp mechanism #4988

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3a2fc46
WIP: FEATURE: Rework CR CatchUp mechanism
bwaidelich Apr 11, 2024
99cd1e0
Remove `react/async` dependency
bwaidelich Apr 12, 2024
e8a0bdd
Remove `react/async` dependency 2/2
bwaidelich Apr 12, 2024
d2382ee
Cosmetic fix to satisfy linter
bwaidelich Apr 13, 2024
7dc35fc
Remove unused namespace imports
bwaidelich Apr 13, 2024
13e1238
Replace `CheckpointStorageInterface`
bwaidelich Apr 14, 2024
4c425cd
Replace `CheckpointStorageInterface`
bwaidelich Apr 14, 2024
b1d28f6
Merge branch 'feature/4746-rework-catchup-mechanism' of https://githu…
bwaidelich Apr 14, 2024
ad57a91
Remove `DbalClientInterface` and implementations
bwaidelich Apr 15, 2024
b817b1d
Update composer manifest
bwaidelich Apr 16, 2024
cb653fd
Tweak checkpoint error message
bwaidelich Apr 16, 2024
43da4c2
Re-add `neos/eventstore-doctrineadapter` dependency
bwaidelich Apr 16, 2024
bb1c498
Mostly cosmetic tweaks to satisfy linter
bwaidelich Apr 16, 2024
e62cb87
Make checkpoint table check a platform specific check
bwaidelich Apr 17, 2024
7cc13ed
Remove notion of "sync" from composer scripts and readme
bwaidelich Apr 17, 2024
fc6ec5c
Remove ProjectionCatchUpTriggerInterface and implementations
bwaidelich Apr 17, 2024
89eada5
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 24, 2024
cc3a191
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 25, 2024
7c8ae2c
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 26, 2024
ed47eb6
Fix ContentStreamProjection checkpoint
bwaidelich Apr 26, 2024
592e78d
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 30, 2024
4af1e3c
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 1, 2024
4c68ca7
BUGFIX: Remove doctrine migrate and cr setup commands from behat scripts
bwaidelich May 1, 2024
7bfd941
Use dedicated connection for EventStore
bwaidelich May 1, 2024
e2e8af6
Re-use previously created event store instances
bwaidelich May 1, 2024
fb9b897
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 6, 2024
082c5ca
Merge remote-tracking branch 'origin/9.0' into feature/4746-rework-ca…
mhsdesign May 17, 2024
adf6eef
TASK: Adjustments after merging 9.0 (beta10) to satisfy phpstan mostly
mhsdesign May 17, 2024
c6920ec
Merge remote-tracking branch 'origin/9.0' into feature/4746-rework-ca…
mhsdesign May 17, 2024
88abe17
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 19, 2024
27f330f
Merge branch 'task/remove-dbal-client' into feature/4746-rework-catch…
bwaidelich May 19, 2024
b4fe6e9
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 19, 2024
3abc8f0
Make ContentGraphTableNames::tableNamePrefix private again
bwaidelich May 19, 2024
3d6edc7
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@test:behat-cli -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:stop-on-failure": [
Expand All @@ -51,7 +50,6 @@
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -vvv --stop-on-failure -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test": [
Expand Down
3 changes: 1 addition & 2 deletions Neos.ContentGraph.DoctrineDbalAdapter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"license": "GPL-3.0+",
"require": {
"neos/contentrepository-core": "self.version",
"doctrine/dbal": "^2.13",
"doctrine/migrations": "*"
"neos/contentrepository-dbaltools": "*"
},
"autoload": {
"psr-4": {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Neos\ContentRepository\Core\Infrastructure\DbalSchemaFactory;
use Neos\ContentRepository\DbalTools\CheckpointHelper;
use Neos\ContentRepository\DbalTools\DbalSchemaFactory;

/**
* @internal
Expand All @@ -28,7 +29,8 @@ public function buildSchema(AbstractSchemaManager $schemaManager): Schema
$this->createNodeTable(),
$this->createHierarchyRelationTable(),
$this->createReferenceRelationTable(),
$this->createDimensionSpacePointsTable()
$this->createDimensionSpacePointsTable(),
CheckpointHelper::checkpointTableSchema($this->contentGraphTableNames->checkpoint()),
]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,38 @@ abstract protected function getProjectionContentGraph(): ProjectionContentGraph;
*/
private function whenNodeAggregateWasMoved(NodeAggregateWasMoved $event): void
{
$this->transactional(function () use ($event) {
foreach ($event->succeedingSiblingsForCoverage as $succeedingSiblingForCoverage) {
$nodeToBeMoved = $this->getProjectionContentGraph()->findNodeInAggregate(
foreach ($event->succeedingSiblingsForCoverage as $succeedingSiblingForCoverage) {
$nodeToBeMoved = $this->getProjectionContentGraph()->findNodeInAggregate(
$event->contentStreamId,
$event->nodeAggregateId,
$succeedingSiblingForCoverage->dimensionSpacePoint
);

if (is_null($nodeToBeMoved)) {
throw EventCouldNotBeAppliedToContentGraph::becauseTheSourceNodeIsMissing(get_class($event));
}

if ($event->newParentNodeAggregateId) {
$this->moveNodeBeneathParent(
$event->contentStreamId,
$nodeToBeMoved,
$event->newParentNodeAggregateId,
$succeedingSiblingForCoverage
);
$this->moveSubtreeTags(
$event->contentStreamId,
$event->nodeAggregateId,
$event->newParentNodeAggregateId,
$succeedingSiblingForCoverage->dimensionSpacePoint
);

if (is_null($nodeToBeMoved)) {
throw EventCouldNotBeAppliedToContentGraph::becauseTheSourceNodeIsMissing(get_class($event));
}

if ($event->newParentNodeAggregateId) {
$this->moveNodeBeneathParent(
$event->contentStreamId,
$nodeToBeMoved,
$event->newParentNodeAggregateId,
$succeedingSiblingForCoverage
);
$this->moveSubtreeTags(
$event->contentStreamId,
$event->newParentNodeAggregateId,
$succeedingSiblingForCoverage->dimensionSpacePoint
);
} else {
$this->moveNodeBeforeSucceedingSibling(
$event->contentStreamId,
$nodeToBeMoved,
$succeedingSiblingForCoverage,
);
// subtree tags stay the same if the parent doesn't change
}
} else {
$this->moveNodeBeforeSucceedingSibling(
$event->contentStreamId,
$nodeToBeMoved,
$succeedingSiblingForCoverage,
);
// subtree tags stay the same if the parent doesn't change
}
});
}
}

/**
Expand Down Expand Up @@ -223,6 +221,4 @@ private function findIngoingHierarchyRelationToBeMoved(


abstract protected function getDatabaseConnection(): Connection;

abstract protected function transactional(\Closure $operations): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo
{
// the focus here is to be correct; that's why the method is not overly performant (for now at least). We might
// lateron find tricks to improve performance
$this->transactional(function () use ($event) {
$ingoingRelations = $this->getProjectionContentGraph()->findIngoingHierarchyRelationsForNodeAggregate(
$event->contentStreamId,
$event->nodeAggregateId,
$event->affectedCoveredDimensionSpacePoints
);
$ingoingRelations = $this->getProjectionContentGraph()->findIngoingHierarchyRelationsForNodeAggregate(
$event->contentStreamId,
$event->nodeAggregateId,
$event->affectedCoveredDimensionSpacePoints
);

foreach ($ingoingRelations as $ingoingRelation) {
$this->removeRelationRecursivelyFromDatabaseIncludingNonReferencedNodes($ingoingRelation);
}
});
foreach ($ingoingRelations as $ingoingRelation) {
$this->removeRelationRecursivelyFromDatabaseIncludingNonReferencedNodes($ingoingRelation);
}
}

/**
Expand Down Expand Up @@ -83,6 +81,4 @@ protected function removeRelationRecursivelyFromDatabaseIncludingNonReferencedNo
}

abstract protected function getDatabaseConnection(): Connection;

abstract protected function transactional(\Closure $operations): void;
}
Loading
Loading