Comments (3)
A possible fix for this bug is to use the combination emitter-id and emitter sequence number as delivery id and store this in a dedicated field of a DurableEvent
. So in the example above E1 would be emitted by A with this field set to A-1
and a persistOnEvent request by B would use this as delivery id instead of the local sequence number.
from eventuate.
This fix sounds reasonable to me as it uses a unique event identifier and not the non-unique local sequence number for referencing events that caused a PersistOnEvent
request.
Instead of using the emitterId
it is sufficient to use the processId
of the event which is also required for extracting the initial local sequence number (i.e. emitter sequence number) from the vectorTimestamp
. An additional method on DurableEvent
should be added to generate this identifier (or even replace the existing id
method as it is not used within Eventuate).
We still need to make sure to preserve the proper emission order of PersistOnEvent
requests which is not given any more by the new identifier. Instead of the current SortedMap[Long, PersistOnEventRequest]
we could use a plain Seq[PersistOnEventRequest]
but this would increase confirmation complexity from O(log n) to O(n) which is not acceptable.
We therefore need to store the new identifier in addition to the currently used persistOnEventSequenceNr
and introduce a second mapping Map[A, PersistOnEventRequest]
(which allows us to make a lookup and removal in the current SortedMap[Long, PersistOnEventRequest]
via the persistOnEventSequenceNr
stored in PersistOnEventRequest
) with complexity O(log n).
The new identifier must be stored in a new DurableEvent
field named persistOnEventReference: Option[A]
. We cannot reuse deliveryId
because it would prevent us from using events for ConfirmedDelivery
that have been generated via persistOnEvent
.
For backwards compatibility we have to deal with the following two situations:
- confirmation events have set both
persistOnEventSequenceNr
andpersistOnEventReference
which allows removal of mapping entries with acceptable complexity i.e O(log n). - confirmation events have only set
persistOnEventSequenceNr
which requires a removal fromMap[A, PersistOnEventRequest]
with complexity O(n) for a limited number of outstandingPersistOnEvent
requests.
from eventuate.
Sounds good to me. A
could either be a dedicated type (like case class EventId(processId: String, sequenceNr: Long)
or a simple String
where processId
and sequenceNr
are concatenated. The dedicated type might provide better type safety, however the string concatenation pattern is already used in other places in eventuate (e.g. for building a log-id).
from eventuate.
Related Issues (20)
- Emit progress data with processed messages
- Allow EventsourcedProcessor to emit events with custom aggregation IDs HOT 12
- Events created by EventsourcedProcessor lack system timestamp
- Common event processing model
- LogEventDispatcherSpec failed
- Improve logging when CassandraEventLog stops itself due to errors when writing
- Add documentation on how to setup akka remoting with TLS
- Support disaster recovery with limited event recovery
- Document that RBMH Eventuate is not Eventuate.io
- Help Users Navigate User Guide Code HOT 15
- Drop support for optional persistOnEventId in PersistOnEventRequest
- Upgrade to Akka 2.5
- Publish .proto files
- Potentially Inconsistent EventLogClock snapshot in Cassandra backend in case of disaster recovery
- Is this thing still on? HOT 2
- Adapt replication batch size dynamically HOT 1
- Using EventsourceProcessors in combination with Replication may lead to loss of processed events HOT 1
- Memory consumption of `LeveldbNumericIdentifierStore` HOT 2
- Replay from Cassandra stops prematurely if there are large sequence number gaps covering empty partitions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventuate.