Skip to content

Commit

Permalink
chore: More detailed error message for invalid replica config
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw committed Nov 9, 2023
1 parent 0e185c8 commit b155052
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ private[akka] object ReplicationImpl {
envelope.eventMetadata match {
case Some(replicatedEventMetadata: ReplicatedEventMetadata) =>
// skipping events originating from other replicas is handled by filtering but for good measure
require(replicatedEventMetadata.originReplica == remoteReplica.replicaId)
if (replicatedEventMetadata.originReplica != remoteReplica.replicaId)
throw new IllegalArgumentException(
"Expected replicated event from replica " +
s"[${remoteReplica.replicaId}] but was [${replicatedEventMetadata.originReplica}]. " +
"Verify your replication configuration, such as self-replica-id.")

val replicationId = ReplicationId.fromString(envelope.persistenceId)
val destinationReplicaId = replicationId.withReplica(settings.selfReplicaId)
Expand Down

0 comments on commit b155052

Please sign in to comment.