-
Notifications
You must be signed in to change notification settings - Fork 17
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
Journal does logical and physical deletion in same transaction #155
Comments
@mdedetrich probably not worth delaying the forthcoming RC for this. I'm on a day trip so can't check in detail. My gut reaction is that looking to improve the performance of the deletes is better than removing them. Maybe a missing db index. OP has not provided any details to back up the claims. |
If by RC you mean the @magnho Is my understanding correct in that if we properly solve this issue it can be done without breaking API and your recommendation of removing |
@mdedetrich I think he want to remove the logical deletion(this is a legacy issue), In fact, we also encountered this perf problem in production, which caused me to give up the jdbc plugin and use we own jdbc implementation instead. |
@mdedetrich Sorry if I was unclear. The It currently works like this:
This is all done in the same transaction, so the result of 1. has no effect outside of this transaction. This makes step 1 and 2 redundant. |
Understood, in that case we can do it after the |
@magnho It also goes without saying that you are free to fix this yourself and contribute a PR. By the time we get to releasing |
Not advocating for removing the deletes, but very happy to get a discussion going here. The idea was that either the logical delete should be removed, or the logical delete is kept and the physical delete is moved. I don't have any clear suggestion for how the latter would be done. |
@Roiocam would you have time to do a PR? |
I don't see why logical delete should be default, although I may be missing something. Having said that I am getting the increasing feeling that this should be configurable? i.e. you configure persistence-jdbc whether to do logical delete or physical delete (and if you configure logical delete then all of the query operations also need to take into account the |
On second thoughts we should release In other words too many big changes in for |
The feature to enable logical deletion was already deprecated and removed in akka/akka-persistence-jdbc#569 The deleted flag though is still used to ensure the last sequence number isn't lost when deleting all events. The other option to keep the deleted flag, we could optimize the delete by deleting up to n - 1, then mark the event n as deleted. That would avoid updating all rows before deleting them. |
Thanks for the input, that's help!
I will finish this on #169 |
DefaultJournalDao.delete(persistenceId: String, maxSequenceNr: Long)
does both logical and physical deletion in the same transaction. We did some load-testing recently (with PostgreSQL) and found that these operations both used a lot of resources.There's probably a case for doing logical deletion in terms of performance, but the way it's implemented now, the logical deletion doesn't make sense, and should probably be removed.
DefaultJournalDao.delete
The text was updated successfully, but these errors were encountered: