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

Ginhoux, Patrick patrick.ginhoux at fr.unisys.com
Tue Apr 4 08:49:09 CEST 2017


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 size is 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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170404/69993fb4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7886 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170404/69993fb4/attachment-0001.bin>


More information about the sr-users mailing list