diff --git a/akka-distributed-data/src/main/scala/akka/cluster/ddata/Replicator.scala b/akka-distributed-data/src/main/scala/akka/cluster/ddata/Replicator.scala index 2735df3ffa..138155b71c 100644 --- a/akka-distributed-data/src/main/scala/akka/cluster/ddata/Replicator.scala +++ b/akka-distributed-data/src/main/scala/akka/cluster/ddata/Replicator.scala @@ -1558,7 +1558,7 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog val otherKeys = otherDigests.keySet val myKeys = if (totChunks == 1) dataEntries.keySet - else dataEntries.keysIterator.filter(_.hashCode % totChunks == chunk).toSet + else dataEntries.keysIterator.filter(key => math.abs(key.hashCode) % totChunks == chunk).toSet val otherMissingKeys = myKeys diff otherKeys val keys = (otherDifferentKeys ++ otherMissingKeys).take(maxDeltaElements) if (keys.nonEmpty) {