Out of curiosity, let’s assume I have started persistent actors with the same persistenceId on several cluster members and “managed” to persist the same type of event – e.g. AccountCreated(username, passwordHash) – with similar but still different data – e.g. same username but different passwords – with the same sequence number.
Then I run an EventsByPersistenceId query. I was assuming that I get a failure or at least two EventEnvelopes with the same sequence number. But surprisingly this does not happen. So the Cassandra plugin seems to deduplicate events with the same sequence number. According to which logic? Latetst timestap?
I don’t think it’s deduplicated by Cassandra because the timestamp is part of the primary key.
I think it’s deduplicated by the ReplayFilter, which detects that there is a new writer but with same seqNr as already received. It’s actually buffering events and discarding the oldest.
You should see a log message from the ReplayFilter when this happens.
That said, the ReplayFilter can’t detect all problems that can occur in those situations, so in general you are in trouble when there are multiple writers.