[SR-Users] Why these 2 items in the same entry for a htable

Daniel-Constantin Mierla miconda at gmail.com
Tue Apr 4 12:45:17 CEST 2017


Hello,

if you are not familiar with hash table structure, take a bit of time to
read about it, a good article on wikipedia:

  - https://en.wikipedia.org/wiki/Hash_table

The dump prints only details of the slots (buckets) that have data on it
(size>0). The entry field in the dump content is practically the index
of the slot.

I hope it helps!

Cheers,
Daniel

On 04.04.17 08:49, Ginhoux, Patrick wrote:
>
> Hi,
>
>  
>
> While working on the project to migrate my kamailio.cfg script from
> kamailio 3.3.1 to 5.0.x, I discovered that in there are 2 items in the
> same htable.
>
>  
>
> Below the figure that illustrate this case :
>
>  
>
> 1)      _Content of the __MBXRANGE table :_
>
>  
>
> mysql> select * from mbxrange;
>
> +-----+-------------+-------------------------------------------------+------------+----------+
>
> | id  | key_name    | key_value                                      
> | value_type | key_type |
>
> +-----+-------------+-------------------------------------------------+------------+----------+
>
> |   0 | VERSION     | 120104-173400        
>                           |          0 |        0 |
>
> | 101 | 1           | min=0100000000;max=0199999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 102 | 2           | min=0200000000;max=0299999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 103 | 3           | min=0300000000;max=0399999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 104 | 4           | min=0400000000;max=0499999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 105 | 5           | min=0500000000;max=0599999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 106 | 6           | min=0600000000;max=0699999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 107 | 7           | min=0700000000;max=0799999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 108 | 8           | min=0800000000;max=0899999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 109 | 9           | min=0900000000;max=0999999999;node=OPMVTS1VSE02
> |          0 |        0 |
>
> | 199 | maxmbxrange | 9                                              
> |          0 |        0 |
>
> +-----+-------------+-------------------------------------------------+------------+----------+
>
> 11 rows in set (0.00 sec)
>
>  
>
> 2)      _modparam instruction used in my kamailio.cfg script:_
>
>  
>
> modparam("htable", "htable", "mbxrangeHash=>size=4;dbtable=mbxrange;")
>
>  
>
> 3)      _Result of « __kamctl fifo sht_dump mbxrangeHash » command
> with __kamailio version 3.3.x:_
>
>  
>
> [root at op52is4router1 ~]# kamctl fifo sht_dump mbxrangeHash
>
> Entry:: 0
>
>         6:: min=0600000000;max=0699999999;node=OPMVTS1VSE02
>
> Entry:: 1
>
>         7:: min=0700000000;max=0799999999;node=OPMVTS1VSE02
>
> Entry:: 2
>
>         4:: min=0400000000;max=0499999999;node=OPMVTS1VSE02
>
> Entry:: 3
>
>         5:: min=0500000000;max=0599999999;node=OPMVTS1VSE02
>
> Entry:: 4
>
>         2:: min=0200000000;max=0299999999;node=OPMVTS1VSE02
>
> Entry:: 5
>
>         3:: min=0300000000;max=0399999999;node=OPMVTS1VSE02
>
>         VERSION:: 120104-173400
>
> Entry:: 6
>
>         maxmbxrange:: 9
>
> Entry:: 7
>
>         1:: min=0100000000;max=0199999999;node=OPMVTS1VSE02
>
> Entry:: 14
>
>         9:: min=0900000000;max=0999999999;node=OPMVTS1VSE02
>
> Entry:: 15
>
>         8:: min=0800000000;max=0899999999;node=OPMVTS1VSE02
>
>  
>
> _Result of « __kamcmd htable.dump mbxrangeHash » command with kamailio
> version 5.0.x :_
>
>  
>
> [root at vm-vse02-siprouter1 ~]# kamcmd htable.dump mbxrangeHash
>
> {
>
>         entry: 0
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 6
>
>                         value:
> min=0600000000;max=0699999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 1
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 7
>
>                         value:
> min=0700000000;max=0799999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 2
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 4
>
>                         value:
> min=0400000000;max=0499999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 3
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 5
>
>                         value:
> min=0500000000;max=0599999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 4
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 2
>
>                         value:
> min=0200000000;max=0299999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 5
>
>         size: 2
>
>         slot: {
>
>                 item: {
>
>                         name: 3
>
>                         value:
> min=0300000000;max=0399999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>                 item: {
>
>                         name: VERSION
>
>                         value: 120104-173400
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 6
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: maxmbxrange
>
>                         value: 9
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 7
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 1
>
>                         value:
> min=0100000000;max=0199999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 14
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 9
>
>                         value:
> min=0900000000;max=0999999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
> {
>
>         entry: 15
>
>         size: 1
>
>         slot: {
>
>                 item: {
>
>                         name: 8
>
>                         value:
> min=0800000000;max=0899999999;node=OPMMMS1VSE02
>
>                         type: str
>
>                 }
>
>         }
>
> }
>
>  
>
> So, I can see :
>
>  
>
> -          The entry number is not incremental 1 by 1 ; there are
> entry #1 to #7, then #14 and #15 (all have size=1)
>
> -          For the entry #5, its sizeis of 2 and it contains 2 items
>
>  
>
> I don’t say here that this is a problem, but the way the htable is
> loaded seems strange to me.
>
>  
>
> So if there people who can explain me if what I see is normal or not,
> and how the htable load process works, I would appreciate.
>
>  
>
> Thanks in advance.
>
>  
>
> Cordialement
>
> Patrick GINHOUX
>
>  
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170404/a7f1defe/attachment.html>


More information about the sr-users mailing list