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

Consider using a single table for checkpoints #4152

Open
bwaidelich opened this issue Mar 31, 2023 · 6 comments · May be fixed by #5321
Open

Consider using a single table for checkpoints #4152

bwaidelich opened this issue Mar 31, 2023 · 6 comments · May be fixed by #5321
Labels

Comments

@bwaidelich
Copy link
Member

bwaidelich commented Mar 31, 2023

Currently we create six tables per CR instance to store the checkpoints of projections.
We should consider using a single table for those instead, since they already use a unique subscriber id (= FQN projection class name).

Note: We might have chosen this approach to make the locking mechanism work (better) – but I'm not sure

@skurfuerst
Copy link
Member

@bwaidelich IMHO there were good reasons for the current approach - making every projection completely self-contained; and I think there were problems with the other approach (I don't remember them fully though).

I am not sure if we should again change this - I don't see any benefits in changing this.

@bwaidelich
Copy link
Member Author

@dlubitz brought it up and I could not answer why we need 19 tables (instead of 13) for a CR instance.
IMO projections would still be self-contained even if they shared a table (they'd have the same schema and the first one would create the table upon cr:setup).

But I'm totally happy with keeping it for now!

@bwaidelich
Copy link
Member Author

bwaidelich commented May 25, 2023

FYI: I had used a single table for a customer project of mine and got a lot of Failed to acquire checkpoint lock for subscriber "..." because it is acquired already errors in production.
When switching to individual tables, the errors were gone..
I need to investigate more closely, but apparently the SELECT ... FOR UPDATE does not reliably lock single rows.

If that's the case we should consider removing the $subscribedId parameter from the DoctrineCheckpointStorage

UPDATE: Nevermind, it was a copy/paste mistake in my case and I used the same subscriber id twice ¯\(ツ)

@skurfuerst
Copy link
Member

Phew, good 😊

@bwaidelich
Copy link
Member Author

Closing for now, because the current implementation has no severe drawbacks

This might be addressed with #4746 (keyword: subscription engine)

@github-project-automation github-project-automation bot moved this from Todo to Done ✅ in Neos 9.0 Release Board Sep 13, 2024
@mhsdesign
Copy link
Member

indeed with the subscription engine we are thinking about doing this: #5321

the problem so far is how to get the transactions right. As even on fatal errors we want the subscription position (checkpoint) to match what the projection has done.

@mhsdesign mhsdesign reopened this Nov 22, 2024
@mhsdesign mhsdesign linked a pull request Dec 10, 2024 that will close this issue
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants