<p></p>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/miconda/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/miconda">@miconda</a> there was a copy&paste error here in my description<br>
complete configuration looks like this:</p>
<pre><code># ----- db_cluster params ------
modparam("db_cluster", "connection", DB_URL_REDIS_READ)
modparam("db_cluster", "connection", DB_URL_REDIS_WRITE)
modparam("db_cluster", "cluster", "cluster1=>c1=9r0p;c2=0r9p")
</code></pre>
<p>So the configuration looks complete according to Readme. Still the debug prints i added revealed the len mismatch.<br>
I have workarounded it in db_cluster module by recalculating the len in db_cluster_init. Here is the patch including the change and debug prints:</p>
<pre><code>diff --git a/src/modules/db_cluster/dbcl_api.c b/src/modules/db_cluster/dbcl_api.c
index 111abcca2..b1ddcd9fc 100644
--- a/src/modules/db_cluster/dbcl_api.c
+++ b/src/modules/db_cluster/dbcl_api.c
@@ -264,27 +264,27 @@ db1_con_t* db_cluster_init(const str* _dburl)
dbcl_cls_t *cls=NULL;
str name;
- LM_DBG("initializing with cluster [%.*s]\n", _dburl->len, _dburl->s);
+ LM_DBG("initializing with cluster [%.*s] len %d\n", _dburl->len, _dburl->s, _dburl->len);
if(_dburl->len<10 || strncmp(_dburl->s, "cluster://", 10)!=0)
{
- LM_ERR("invlaid url for cluster module [%.*s]\n",
+ LM_ERR("invalid url for cluster module [%.*s]\n",
_dburl->len, _dburl->s);
return NULL;
}
name.s = _dburl->s + 10;
- name.len = _dburl->len - 10;
+ name.len = strlen(_dburl->s) - 10;
trim(&name);
cls = dbcl_get_cluster(&name);
if(cls==NULL)
{
LM_ERR("cluster not found [%.*s]\n",
- _dburl->len, _dburl->s);
+ name.len, name.s);
return NULL;
}
if(dbcl_init_dbf(cls)<0)
{
LM_ERR("cluster [%.*s] - unable to bind to DB engines\n",
- _dburl->len, _dburl->s);
+ name.len, name.s);
return NULL;
}
dbcl_init_connections(cls);
</code></pre>
<p>I will re-test it against the latest master and report if I still need the patch.<br>
But was thinking perhaps that the root cause is some changes in srdb1 lib.</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#issuecomment-652861640">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJDPLBCLDT62NCP3GLRZQ7KDANCNFSM4ONS2LRQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZKWLCWI4CTOYON6KZTRZQ7KDA5CNFSM4ONS2LR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE3U6BSA.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#issuecomment-652861640",
"url": "https://github.com/kamailio/kamailio/issues/2385#issuecomment-652861640",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>