<div dir="ltr"><div dir="ltr">Hi Paul,<div><br></div><div>You cannot disable database completely for presence - subs_db_mode refers only to subscriber records (active_watchers).</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Cheers,</div><div><br></div><div>Charles</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 8 Mar 2019 at 14:15, <<a href="mailto:paul@irishvoip.com">paul@irishvoip.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div>Hi there</div><div><br></div><div>My config is a primary:secondary DNS srv failover Kamailio 5.2 setup using DMQ for syncing Location, Presence, HTable etc.</div><div><br></div><div>For Presence db_mode set to 0 on both servers.</div><div><br></div><div>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.</div><div><br></div><div>Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query<br>Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: db_mysql [km_dbase.c:714]: db_mysql_end_transaction(): executing raw_query<br>Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: presence [presentity.c:1299]: update_presentity(): in end_transaction<br>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)<br></div><div><br></div><div>I am using the following presence related modules</div><div><br></div><div>loadmodule "presence.so"<br>loadmodule "presence_mwi.so"<br>loadmodule "presence_xml.so"<br>loadmodule "pua.so"<br>loadmodule "rls.so"<br>loadmodule "xcap_server.so"<br>loadmodule "xcap_client.so"</div><div><br></div><div>params are set as below</div><div><br></div><div><br>loadmodule "presence.so"<br>loadmodule "presence_mwi.so"<br>loadmodule "presence_xml.so"<br>loadmodule "pua.so"<br>loadmodule "rls.so"<br>loadmodule "xcap_server.so"<br>loadmodule "xcap_client.so"<br><br>params are set as below with PRESENCEDBMODE set to 0 on both servers.<br><br>#!ifdef WITH_PRESENCE<br># ----- presence params -----<br>modparam("presence", "db_url", DBURL)<br>modparam("presence", "db_update_period", 5)<br>modparam("presence", "server_address", "sip:<a href="http://myserver.com" target="_blank">myserver.com</a>")<br>modparam("presence", "subs_db_mode", PRESENCEDBMODE)<br>modparam("presence", "send_fast_notify", 1)<br>modparam("presence", "timeout_rm_subs", 0)<br>modparam("presence", "db_table_lock_type", 0)<br>modparam("presence", "notifier_processes", 3)<br>modparam("presence", "local_log_level", 3)<br>modparam("presence", "publ_cache", 1)<br>#!ifdef WITH_DMQ<br>modparam("presence", "enable_dmq", 1)<br>#!else<br>modparam("presence", "enable_dmq", 0)<br>#!endif<br><br>#!ifdef WITH_BUDDY<br># ----- presence_xml params -----<br>modparam("presence_xml", "db_url", DBURL)<br>modparam("presence_xml", "passive_mode", 1)<br>modparam("presence_xml", "integrated_xcap_server", 1)<br>modparam("presence_xml", "xcap_server", "<a href="https://xcap.myserver.com/xcap-root" target="_blank">https://xcap.myserver.com/xcap-root</a>")<br>modparam("presence_xml", "force_dummy_presence", 1)<br>modparam("pua", "db_url", DBURL)<br>modparam("pua", "db_mode", PRESENCEDBMODE)<br>modparam("pua", "db_table_lock_write", 0)<br>modparam("pua", "check_remote_contact", 0)<br><br>modparam("rls", "db_url", DBURL)<br>modparam("rls", "db_mode", PRESENCEDBMODE)<br>modparam("rls", "notifier_processes", 2)<br>modparam("rls", "integrated_xcap_server", 1)<br>modparam("rls", "xcap_root", "<a href="https://xcap.myserver.com/xcap-root" target="_blank">https://xcap.myserver.com/xcap-root</a>")<br>modparam("rls", "server_address", "<a href="mailto:sip%3Arls@myserver.com" target="_blank">sip:rls@myserver.com</a>")<br>modparam("rls", "outbound_proxy", "sip:<a href="http://myserver.com" target="_blank">myserver.com</a>")<br>modparam("rls", "disable_remote_presence", 0)<br>modparam("rls", "max_backend_subs", 1000)<br>modparam("rls", "to_presence_code", 10)<br>modparam("rls", "rls_event", "presence")<br>modparam("rls", "rls_event", "presence.winfo")<br>modparam("xcap_server", "db_url", DBURL)<br>modparam("xcap_server", "directory_scheme", -1)<br>modparam("xcap_server", "xcap_root", "/xcap-root/")<br>modparam("xcap_client", "db_url", DBURL)<br>modparam("xcap_client", "query_period", 50)<br></div><div><br></div><div>Any ideas?</div><div><br></div><div>thanks</div><div>Paul</div></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br clear="all"><div><br></div></div>

<br>
<div><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font><span style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"> </span><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></div>