Hi Paul,

You cannot disable database completely for presence - subs_db_mode refers only to subscriber records (active_watchers).

It sounds like you are replicating at DB level between the two servers - is this correct? If using DMQ then you should really leave the two DBs as standalone/local instances.

Just to note, DMQ replication is of presentity updates only - it is not designed to replicate watchers and is meant to be used in an active:active (clustered) configuration whereby each instance manages its own set of subscribers. If a presentity state changes on one server, it will notify its own subscribers and also send the update to the other servers so they can in turn notify their own subscribers.

For active:passive configurations where you just need a standby in case the primary fails, it is more appropriate to use DB replication only and remove DMQ from the equation.

Cheers,

Charles


On Fri, 8 Mar 2019 at 14:15, <paul@irishvoip.com> wrote:
Hi there

My config is a primary:secondary DNS srv failover Kamailio 5.2 setup using DMQ for syncing Location, Presence, HTable etc.

For Presence db_mode set to 0 on both servers.

This works fine on the primary server but on the secondary server I get repeated mysql deadlock errors. I seem to be missing a config setting to turn off db_mode fully for presence but I cant see where. Error seems to occur on message-summary updates from master that are being replicated to slave via DMQ.

Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query
Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: db_mysql [km_dbase.c:714]: db_mysql_end_transaction(): executing raw_query
Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: presence [presentity.c:1299]: update_presentity(): in end_transaction
Mar 08 13:52:40 /usr/sbin/kamailio[17493]: ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query: Deadlock found when trying to get lock; try restarting transaction (1213)

I am using the following presence related modules

loadmodule "presence.so"
loadmodule "presence_mwi.so"
loadmodule "presence_xml.so"
loadmodule "pua.so"
loadmodule "rls.so"
loadmodule "xcap_server.so"
loadmodule "xcap_client.so"

params are set as below


loadmodule "presence.so"
loadmodule "presence_mwi.so"
loadmodule "presence_xml.so"
loadmodule "pua.so"
loadmodule "rls.so"
loadmodule "xcap_server.so"
loadmodule "xcap_client.so"

params are set as below with PRESENCEDBMODE set to 0 on both servers.

#!ifdef WITH_PRESENCE
# ----- presence params -----
modparam("presence", "db_url", DBURL)
modparam("presence", "db_update_period", 5)
modparam("presence", "server_address", "sip:myserver.com")
modparam("presence", "subs_db_mode", PRESENCEDBMODE)
modparam("presence", "send_fast_notify", 1)
modparam("presence", "timeout_rm_subs", 0)
modparam("presence", "db_table_lock_type", 0)
modparam("presence", "notifier_processes", 3)
modparam("presence", "local_log_level", 3)
modparam("presence", "publ_cache", 1)
#!ifdef WITH_DMQ
modparam("presence", "enable_dmq", 1)
#!else
modparam("presence", "enable_dmq", 0)
#!endif

#!ifdef WITH_BUDDY
# ----- presence_xml params -----
modparam("presence_xml", "db_url", DBURL)
modparam("presence_xml", "passive_mode", 1)
modparam("presence_xml", "integrated_xcap_server", 1)
modparam("presence_xml", "xcap_server", "https://xcap.myserver.com/xcap-root")
modparam("presence_xml", "force_dummy_presence", 1)
modparam("pua", "db_url", DBURL)
modparam("pua", "db_mode", PRESENCEDBMODE)
modparam("pua", "db_table_lock_write", 0)
modparam("pua", "check_remote_contact", 0)

modparam("rls", "db_url", DBURL)
modparam("rls", "db_mode", PRESENCEDBMODE)
modparam("rls", "notifier_processes", 2)
modparam("rls", "integrated_xcap_server", 1)
modparam("rls", "xcap_root", "https://xcap.myserver.com/xcap-root")
modparam("rls", "server_address", "sip:rls@myserver.com")
modparam("rls", "outbound_proxy", "sip:myserver.com")
modparam("rls", "disable_remote_presence", 0)
modparam("rls", "max_backend_subs", 1000)
modparam("rls", "to_presence_code", 10)
modparam("rls", "rls_event", "presence")
modparam("rls", "rls_event", "presence.winfo")
modparam("xcap_server", "db_url", DBURL)
modparam("xcap_server", "directory_scheme", -1)
modparam("xcap_server", "xcap_root", "/xcap-root/")
modparam("xcap_client", "db_url", DBURL)
modparam("xcap_client", "query_period", 50)

Any ideas?

thanks
Paul
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.