[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1275) Virtual nodes producing same hash id for two different cluster nodes

Dan Berindei (JIRA) jira-events at lists.jboss.org
Thu Jul 28 13:15:24 EDT 2011


    [ https://issues.jboss.org/browse/ISPN-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617347#comment-12617347 ] 

Dan Berindei commented on ISPN-1275:
------------------------------------

I think I know what's going on. When two nodes are allocated the same address one of them will get bumped to the next free slot on the hash wheel.

There are some tests that rely on the node address mapping to that node, so I wrote the CH algorithm to first allocate the "physical" address on the hash wheel and only after all the physical nodes are on the wheel to allocate the virtual nodes. So the positions of the virtual nodes can change by +/-1 as a node is added to/removed from the consistent hash.

If we want to change this so that a nodes' positions in the hash wheel never change, we have to 
1) Remove the distinction between "physical" and "virtual", allocate all the node's positions at the same time
2) Ensure that nodes are always processed in the order they have in the JGroups view (assuming the order is the same on all the nodes). Right now we first convert the list of addresses to a HashSet in ConsistentHashHelper, that will practically ensure that a newly added node will not be processed last.

> Virtual nodes producing same hash id for two different cluster nodes
> --------------------------------------------------------------------
>
>                 Key: ISPN-1275
>                 URL: https://issues.jboss.org/browse/ISPN-1275
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Distributed Cache
>    Affects Versions: 5.0.0.CR8
>            Reporter: Galder Zamarreño
>            Assignee: Dan Berindei
>            Priority: Blocker
>             Fix For: 5.0.0.FINAL
>
>         Attachments: hashids.log
>
>
> While working on ISPN-1273, I've discovered that when virtual nodes are enabled, ConsistentHash.getHashIds(address) can return the same hash for two different cluster nodes. Example: with 500 virtual nodes, both NodeA-23181 and NodeB-39177 produce hash id *5289*. See attached log.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the infinispan-issues mailing list