[infinispan-dev] Denormalizing hashes

Radim Vansa rvansa at redhat.com
Tue Dec 10 13:17:22 EST 2013


Hi Galder,

as I am trying to debug some problem in C++ client, I was looking into 
the server code. And I am not sure whether I understand the code 
correctly, but it seems to me that the server denormalizes the 
consistent hash for each client anew (after each topology change or 
client joining). Is this true? Looking into trace logs, I can see stuff 
like

18:15:17,339 TRACE [org.infinispan.server.hotrod.Encoders$Encoder12$] 
(HotRodServerWorker-12) Writing hash id 639767 for 192.168.11.101:11222

 From denormalizeSegmentHashIds() method I see that this means that we 
have executed the hash function 639768 times just to notify one client. 
Is my understanding correct?

Also, there is nothing like the concept of primary owner, is this right? 
I thought that every first request in HotRod will go to primary owner, 
so that the PUT does not have to do the first hop and is executed 
directly on the primary. But it seems to me that it goes to any of the 
owners (practically random one, as you are only looking for the numOwner 
ids in leeway = on the beginning of the range - then, 99.98% or more 
requests should go to the server with last position in the leeway). This 
looks pretty suboptimal for writes, isn't it?

Cheers

Radim

PS: for every line of code you write in Scala, God kills a kitten

-- 
Radim Vansa <rvansa at redhat.com>
JBoss DataGrid QA



More information about the infinispan-dev mailing list