Replies: 6 comments 20 replies
-
@Roiocam @kerr @mdedetrich Let's delay the 1.1 releases while we work this out. I would prefer not to rush any changes to our APIs. |
Beta Was this translation helpful? Give feedback.
-
TL;DR: NOT need to modify APIs (both user-facing or internal). If deletion or update results are ineffective, The user API was started from Effect, there is no any API about delete in EventSourced mode, it was DurableState specific. I think we need to consider API and our promise about it. In EventSourced:
What about DurableState? for now:
Based on the known assumptions mentioned above (which may not be entirely correct), I am curious about the guarantee of deletion operations in DurableState under network partition. Before that, let's discuss network partitioning under EventSourcing: Actors will continuously increment versions, and ID + Version is a unique primary key. In case of network partition, the following scenario may occur:
In EventSourced mode, data integrity is implicitly protected by the database. But what about DurableState?
Therefore any updates or deletions should be rejected so that Actors can recover from exceptions by reading from So I believe we might not need to modify APIs (both user-facing or internal). If deletion or update results are ineffective, |
Beta Was this translation helpful? Give feedback.
-
To be clear, I don't support an API change either. I am getting a lot of suggestions to make API breaking changes in apache/pekko-persistence-jdbc#156. I would prefer not to change the result behaviour. I simply want to respect the revision param. My preference is to not worry if no rows are deleted, as is the case in the v1.0 API. |
Beta Was this translation helpful? Give feedback.
-
@jtjeferreira I'm wondering if you might have an opinion on this. I can see the point about exposing if the delete calls have no impact but at the same I would worry that changing the behaviour of the existing API to potentially fail if no rows are deleted may be unexpected by users used to the existing solution. |
Beta Was this translation helpful? Give feedback.
-
The 'revision' parameter was added in 66afe3f#diff-98235104917c7f9b25edc73a7d095c7b16a7047a9a6737d58198724b560f0af3 . If I recall correctly, the point of the revision is to act as an optimistic lock: someone looking to update the record would read the current state and revision, make changes to the state, and write it with the 'next' revision number. If a different writer had written to the same state in the mean time, the write fails (and can be retried taking into account the 'newly-written' state if necessary). I think it would be consistent with the API for I'm not convinced existing Akka/Pekko users would be "justifiably unhappy" if we change the existing |
Beta Was this translation helpful? Give feedback.
-
Design Proposal for Pekko 1.1 changes
wdyt @raboof @mdedetrich @Roiocam @kerr |
Beta Was this translation helpful? Give feedback.
-
See apache/pekko-persistence-jdbc#156 for background.
The idea is that
Future[Done]
isn't informative enough as a return type.Unfortunately, doing a Future.failed and throwing an exception if nothing is deleted is a behaviour change even if the return type allows this. Existing Akka/Pekko users could justifiably to be unhappy if we change the existing API to fail when there are no rows to delete instead of returning a Success with Done.
Ideally any new functions should default to calling the existing deleteObject API functions so that we don't force every Persistence implementation to uptake it.
Beta Was this translation helpful? Give feedback.
All reactions