Hi Fred,
On 13.06.13 19:24, fred wrote:
> Hello list,
>
> Reading the idempotency section of the project's doc I decided to try
> checking if sequenceNr were generated sequentially, i.e.,
> newSequenceNr = lastSequenceNr + 1.
You cannot make any assumptions on the size of gaps between the sequence
numbers.
>
> I have 4 different processors (they all have unique processorId) say
> processor[1-4] and they use the same (HBase) journal.
>
> I sent 1 Message to each of the 4 processor, what I see is:
> Message in processor1 has sequenceNr == 1
> Message in processor2 has sequenceNr == 2
> Message in processor3 has sequenceNr == 3
> Message in processor4 has sequenceNr == 4
>
> It seems there's some kind of synchronization between different
> processors and I see no reason for that, is it an implementation
> choice or does this happen because of a mistake I did somewhere?
Sequence numbers are assigned by the journal actor that is configured
for an EventsourcingExtension. All processors that have been created
with this extension share the same journal actor instance. In other
words, there's one sequence number generator per EventsourcingExtension
(and hence per ActorSystem). Future versions of Eventsourced may use
this as a basis for vector clocks in applications composed of several
distributed ActorSystems.
Having sequence numbers generated by a single actor instance doesn't
actually mean that writes to the backend store are also made
sequentially. For example, the HBase journal is able to make concurrent
writes and re-sequence the outcome of the writes before forwarding the
written messages to processors (using the previously generated sequence
numbers).
>
> From an older event table though, I had messages for different
> processors having sometimes (rarely) the same sequenceNr.
Actors from different ActorSystems may see the same sequence number
(each ActorSystem uses its own journal instance). If you want to share
the same event table in HBase across all Actorystems (which is a
frequent use case) you need to ensure that all processors (across all
ActorSystems) have different ids.
>
> What I was hoping:
> sequenceNr of Message for every processor start at 1, and increment in
> steps of 1.
This is not the case.
> That way we can check for duplicates (as written in the idempotency
> section) AND check for missing messages.
There are several other ways to check for missing messages. Can you
sketch your use case please?
>
> Thank you, Fred
> --
> You received this message because you are subscribed to the Google
> Groups "Eventsourced User List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
eventsourced...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
--
Martin Krasser
blog:
http://krasserm.blogspot.com
code:
http://github.com/krasserm
twitter:
http://twitter.com/mrt1nz