[OpenSIPS-Users] opensips locks if use db_virtual with few DB slaves and one slave becomes unavailable

kertor-f at yandex.ru kertor-f at yandex.ru
Wed Aug 15 06:44:53 EDT 2018


Hello collegues! I have problem with module db_virtual.

Configuration: I have two slave DB, opensips cottected to them over db_virtaul in ROUND mode:
########################################################################
loadmodule "db_virtual.so"
########################################################################
modparam("db_virtual", "db_urls", "define set1 ROUND")
modparam("db_virtual", "db_urls", "postgres://psql:pass@10.0.0.1/opensips")
modparam("db_virtual", "db_urls", "postgres://psql:pass@10.0.0.2/opensips")
modparam("db_virtual", "db_max_consec_retrys", 3)
########################################################################
If both DB in set1 is reacheble and works correctly, then opensips works correctly too.


Problem: If i stops DB on one of both slaves (works with server), for example on 10.0.0.1, then opensips is locking. 
I mean, DB on slave 10.0.0.1 becomes unreachable, but DB on slave 10.0.0.2 is works correctly and reacheble.
I see big queues in opensips graph in zabbix.
When i disable db_virtual and configure use of module db_postgres on reacheble 10.0.0.2, problem is gone.

In docs i see:
ROUND (round-robin)
Use the next URL each time; if it fails, use the next one, redo operation.

Can you help me to understand, is this correct behaviour of db_virtual?
Maybe i need to use "failover" or "parralel" modes for resolve problem, then one of both bd slaves may be unreacheble?
Thanks!

opensips -V
version: opensips 2.3.4 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, HP_MALLOC, FAST_LOCK-FUTEX-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
git revision: c59e42e
main.c compiled on 00:13:23 Jun 28 2018 with gcc 4.8.3



More information about the Users mailing list