瀏覽代碼

Fixed a bug in HashRing::remove()

Daniele Alessandri 16 年之前
父節點
當前提交
1a8f832d6c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -692,7 +692,7 @@ class HashRing {
     public function remove($node) {
         $nodeHash = (string) $node;
         for ($i = 0; $i < $this->_replicas; $i++) {
-            $key = crc32($nodeHash . '_' . $i);
+            $key = crc32($nodeHash . ':' . $i);
             unset($this->_ring[$key]);
             $this->_ringKeys = array_filter($this->_ringKeys, function($rk) use($key) {
                 return $rk !== $key;