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

Draft
wants to merge 26 commits into
base: 9.0
Choose a base branch
from

Conversation

bwaidelich
Copy link
Member

@bwaidelich bwaidelich commented Apr 11, 2024

related: #4746

WIP because:

@github-actions github-actions bot added the 9.0 label Apr 11, 2024
@bwaidelich bwaidelich force-pushed the feature/4746-rework-catchup-mechanism branch from 1138434 to 3a2fc46 Compare April 11, 2024 15:57
@@ -44,7 +44,6 @@ public function __construct()
self::bootstrapFlow();
$this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);

$this->setupCRTestSuiteTrait();
Copy link
Member Author

Choose a reason for hiding this comment

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

no longer needed, see

{
$store = new SemaphoreStore();
$factory = new LockFactory($store);
$lock = $factory->createLock('catchup');
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: This lock needs to be CR specific (i.e. include $this->id)

@@ -153,6 +159,67 @@ public function projectionState(string $projectionStateClassName): ProjectionSta
throw new \InvalidArgumentException(sprintf('A projection state of type "%s" is not registered in this content repository instance.', $projectionStateClassName), 1662033650);
}

public function catchUpProjections(): void
{
$store = new SemaphoreStore();
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 has to become an external dependency and/or coordinated with #4751

@nezaniel
Copy link
Member

This already looks very promising and I like the direction this is taking!
What part is still missing / incomplete? Just the new catchup implementation, right?

@bwaidelich
Copy link
Member Author

This already looks very promising and I like the direction this is taking!

Thanks for the feedback, appreciated!

What part is still missing / incomplete?

I added some more lines to the task list above

Copy link
Member

@mhsdesign mhsdesign left a comment

Choose a reason for hiding this comment

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

Thats a lot of stuff but looks "good" so far (considering this is WIP) ... i went through all php classes by reading except the last 20 with only the +-1 changes

Copy link
Member

Choose a reason for hiding this comment

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

why do we need this file now? ^^

Comment on lines +93 to +94
#print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));exit;
#\Neos\Flow\var_dump('HANDLE ' . $command::class);
Copy link
Member

Choose a reason for hiding this comment

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

wip

Comment on lines +129 to +136
return new class {
/**
* @deprecated backwards compatibility layer
*/
public function block(): void
{
}
};
Copy link
Member

Choose a reason for hiding this comment

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

if we were to merge this like this - which i think is not necessary - we should use an actual class so its inspectable via phpstorm :) But i dont think we need b/c layer for new code

$catchUpHook?->onBeforeEvent($event, $eventEnvelope);
$projection->apply($event, $eventEnvelope);
// TODO this should happen in the inner transaction
Copy link
Member

Choose a reason for hiding this comment

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

todo over here :)

];
$projectionsAndCatchUpHooks[$projectionClassName]['catchUpHook']?->onBeforeCatchUp();
}
#\Neos\Flow\var_dump('CATCHUP from ' . $lowestAppliedSequenceNumber->value);
Copy link
Member

Choose a reason for hiding this comment

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

.. lots of debug code and i guess todos?

Copy link
Member

Choose a reason for hiding this comment

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

what is the idea behind the removal of this?

Copy link
Member

Choose a reason for hiding this comment

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

i guess this is now part of CheckpointHelper? Good think we have it in the Core and now our lower level package ^^

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

Successfully merging this pull request may close these issues.

None yet

3 participants