<p></p>
<p>Hi,<br>
using kamailio 5.3, I have added two connections to the cluster:</p>
<pre><code>modparam("db_cluster", "connection", DB_URL_REDIS_READ)
modparam("db_cluster", "connection", DB_URL_REDIS_WRITE)
modparam("ims_charging", "db_url", "cluster://cluster1")
</code></pre>
<p>it fails to start, here with additional debug prints</p>
<pre><code>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]
</code></pre>
<p>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,<br>
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")</p>
<p>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<br>
and then I found this commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279/hovercard" href="https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279"><tt>5457bcb</tt></a></p>
<p>What I am getting at is:<br>
is it possible that commit in srdb1 with id <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279/hovercard" href="https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73f956aa279"><tt>5457bcb</tt></a> broke the db_cluster module in 2014?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2385">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZO4D62VLI3OSFCEW33RZNROVANCNFSM4ONS2LRQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZMFBYWFFYRWIGTIOS3RZNROVA5CNFSM4ONS2LR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JVQ2NUA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2385",
"url": "https://github.com/kamailio/kamailio/issues/2385",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>