Make sure the hashcode is not negative when selecting key chunk #22487
This commit is contained in:
parent
7a0e5b31f8
commit
1e6b8ec86b
1 changed files with 1 additions and 1 deletions
|
|
@ -1558,7 +1558,7 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
|
||||||
val otherKeys = otherDigests.keySet
|
val otherKeys = otherDigests.keySet
|
||||||
val myKeys =
|
val myKeys =
|
||||||
if (totChunks == 1) dataEntries.keySet
|
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 otherMissingKeys = myKeys diff otherKeys
|
||||||
val keys = (otherDifferentKeys ++ otherMissingKeys).take(maxDeltaElements)
|
val keys = (otherDifferentKeys ++ otherMissingKeys).take(maxDeltaElements)
|
||||||
if (keys.nonEmpty) {
|
if (keys.nonEmpty) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue