[sr-dev] [kamailio/kamailio] dispatcher : better distribution when using hash and destination is not available (#2363)

Kalki70 notifications at github.com
Thu Jul 9 18:24:12 CEST 2020


There are several misunderstanding of the code

As I mentioned, I didn't find a function to do hash natively over an integer, so I used a string. I also asked, if there was any I could use, but received no answer. I guess std::hash is out of the question.

It's wrong to consider that hash will be done over "1", "2", "3", etc. Those are the indexes to the servers. I am not doing a hash over the indexes, but over the original hashes.

Also, my fault. maxRehash has a very misleading name. It was born as a "max", but then used as a counter. If Daniel could have read two lines above :

```			
				maxRehash--;
			}
			while (( maxRehash > 0 ) && ds_skip_dst(idx->dlist[fullHash % listSize].flags ) );

```
It's impossible to have there an infinite loop.

I don't like it as a new algorithm. And it has no sense to use it with other algorithms. It has sense only wth hash algorithms.

Forget the request. I withdraw it. I will use a patched version at my work.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2363#issuecomment-656224485
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200709/113f1678/attachment-0001.htm>


More information about the sr-dev mailing list