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

FEATURE: Decentral subscription store #5377

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Nov 24, 2024

Allows to run projections in a different database WITH their store to ensure exactly once delivery and that on critical error (memory error) the transaction is not committet and that the projection in the other db is not already ahead.

TODO, allow to use actually wire it together via cr registry, That one projection runs in one database WITH its subscription store.

see #5321 (comment)

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

Allows to run projections in a different database WITH their store to ensure exactly once delivery and that on critical error (memory error) the transaction is not committet and that the projection in the other db is not already ahead.

TODO, allow to use actually wire it together via cr registry, That one projection runs in one database WITH its subscription store.
Comment on lines +268 to +269
// TODO we cannot mark a subscriber as detached, if it belongs to another store and no one else is using that store anymore. Then it will just be ACTIVE and never found, not even by status
if (!$subscribers->contain($subscription->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.

but if the package is reinstalled, the old database entry will be found stating that it is still ACTIVE meaning that any interaction leading to a catchup active will lead to that the possibly really far behind projection will get a full update

@mhsdesign
Copy link
Member Author

superseeded by #5383

by using individual transactions per projection per event the same guarantees are met, just simpler :D

@mhsdesign mhsdesign closed this Dec 2, 2024
@mhsdesign
Copy link
Member Author

superseeded by #5383 not anymore. We will not go with that approach of using a central lock and actually and discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no guarantee except when using a dedicated store like here. So maybe in another live well still need this lets see :) but not for 9.0!

We might introduce some kind of special connection interface concept thingy to declare for the cr factory and wiring that its important that the same connection is to be used.

mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this pull request Dec 3, 2024
This reverts commit dc5ff10.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos#5377
neos-bot pushed a commit to neos/contentgraph-doctrinedbaladapter that referenced this pull request Dec 16, 2024
This reverts commit 194f387.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos/neos-development-collection#5377
neos-bot pushed a commit to neos/contentgraph-postgresqladapter that referenced this pull request Dec 16, 2024
This reverts commit 22eb7e4.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos/neos-development-collection#5377
neos-bot pushed a commit to neos/contentrepository-core that referenced this pull request Dec 16, 2024
This reverts commit 90ed483.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos/neos-development-collection#5377
neos-bot pushed a commit to neos/contentrepositoryregistry that referenced this pull request Dec 16, 2024
This reverts commit 4d72af1.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos/neos-development-collection#5377
neos-bot pushed a commit to neos/neos that referenced this pull request Dec 16, 2024
This reverts commit e581df2.

We discussed that we dont want to ensure exactly once delivery for external projections. Adding transaction logic via traits for the projections increases logic there. And while with alot of effort we could bring exactly once delivery to work for most cases php could still decide to die in the small timeframe where we commit the one transaction and then the second. So there is no gurantee except when using a dedicated store: neos/neos-development-collection#5377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant