Hi,
using kamailio 5.3, I have added two connections to the cluster:
```
modparam("db_cluster", "connection", DB_URL_REDIS_READ)
modparam("db_cluster", "connection", DB_URL_REDIS_WRITE)
modparam("ims_charging", "db_url", "cluster://cluster1")
```
it fails to start, here with additional debug prints
```
2020-06-30T20:51:10.003728531Z 0(128) DEBUG: db_cluster [dbcl_api.c:267]:
db_cluster_init(): initializing with cluster [cluster://k1] len 46
2020-06-30T20:51:10.003751277Z 0(128) DEBUG: db_cluster [dbcl_api.c:277]:
db_cluster_init(): call dbcl_get_cluster with trimmed name of cluster [k1] len
36
2020-06-30T20:51:10.003772897Z 0(128) DEBUG: db_cluster [dbcl_data.c:67]:
dbcl_get_cluster(): inside dbcl_get_cluster looking up new cluster [k1] len 36
2020-06-30T20:51:10.003801798Z 0(128) DEBUG: db_cluster [dbcl_data.c:75]:
dbcl_get_cluster(): checking new 2749854490 cluster with name [k1] len 36
2020-06-30T20:51:10.003825383Z 0(128) DEBUG: db_cluster [dbcl_data.c:76]:
dbcl_get_cluster(): checking 26214 cluster with name [k1] len 2
2020-06-30T20:51:10.003844796Z 0(128) ERROR: db_cluster [dbcl_api.c:281]:
db_cluster_init(): cluster not found [cluster://k1]
```
so i see different hash id and the length mismatch, where it seems that
db_cluster_init already gets wrong dburl strict structure from DB API,
because the _dburl.s is pointing to the db_url but the length is calculated
from the 2nd connection URL so 36 = strlen
("c2=>mysql://scscf:heslo@mysql/scscf2")
I couldn't get it work also with only 1 connection. I could only tell there is
something wrong with the way db_do_init2 / new_db_id from srdb1 interacts with
db_cluster_init
and then I found this commit
[https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279](https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279)
What I am getting at is:
is it possible that commit in srdb1 with id
5457bcbc51012e93775c3aaefa32c73f956aa279 broke the db_cluster module in 2014?
--
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/issues/2385
_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev