<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">If you are using shared db you should be disabling the features for managing the schema.  The issue is you will need to manually maintain your schema.  Almost always we manage schema it a way that is backwards compatible so you can do staged upgrades if you manually add to the tables.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 10, 2019, at 5:45 AM, Praveen Chourasia <<a href="mailto:praveen.chourasia@outlook.com" class="">praveen.chourasia@outlook.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class="">Hi Frédérick,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class="">PostgreSQL BDR uses 'Master-Master' replication and requires locking if any of the PostgreSQL BDR nodes (that are in replication cluster)  executes DDL SQL queries. It causes the whole cluster to lock as far as I remember.</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class="">The reason you may be experiencing the database getting locked when you restart one of the FreeSWITCH nodes is that FreeSWITCH upon its start/restart executes DDL queries. </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class="">FreeSWITCH AFAIK unconditionally executes 'DROP TABLE/VIEW...' and 'CREATE TABLE/VIEW ...' for tables like 'channels', 'calls', 'interfaces', 'tasks' (TABLES) & 'detailed_calls', 'basic_calls' (VIEWS) that ultimately leads to PostgreSQL BDR getting locked.</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 10pt;" class=""><br class=""></div><div id="Signature" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div id="divtagdefaultwrapper" dir="ltr" style="font-size: 10pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><font face="Calibri" size="2" color="#5133ab" style="font-size: 10pt;" class="">--</font><div class=""><font face="Calibri" size="2" color="#5133ab" style="font-size: 10pt;" class=""><font face="Calibri" color="#5133ab" style="font-size: 10pt;" class=""><b class="">Praveen Chourasia</b><br class=""></font><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 13.3333px;" class=""></span><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 13.3333px;" class=""><br class=""></div></font><div class=""><span style="font-family: Calibri; font-size: 10pt;" class=""><u class=""><font color="#2672ec" class=""></font></u></span></div></div></div></div><div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div><hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 842.796875px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>FreeSWITCH-users <<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" class="">freeswitch-users-bounces@lists.freeswitch.org</a>> on behalf of Frédérick Pruneau <<a href="mailto:frederick@targointernet.com" class="">frederick@targointernet.com</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, May 6, 2019 7:38 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:freeswitch-users@lists.freeswitch.org" class="">freeswitch-users@lists.freeswitch.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[Freeswitch-users] FS can't reconnect to PostgreSQL database</font><div class=""> </div></div><div class="BodyFragment" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><font size="2" class=""><span style="font-size: 11pt;" class=""><div class="PlainText">Hi guys,<br class=""><br class="">I have an issue with FS unable to reconnect to postgresql database. Here<span class="Apple-converted-space"> </span><br class="">is the setup: 2 FreeSWITCH servers with 2 postgresql servers. Each<span class="Apple-converted-space"> </span><br class="">freeswitch is connected to 1 postgresql server. DB servers are synced<span class="Apple-converted-space"> </span><br class="">with BDR. It was working very well until I restarted freeswitch service<span class="Apple-converted-space"> </span><br class="">on one of the servers. Then, I got theses errors showing up on<span class="Apple-converted-space"> </span><br class="">freeswitch console:<br class=""><br class="">switch_pgsql.c:384 Query X took too long to complete or database not<span class="Apple-converted-space"> </span><br class="">responding.<br class=""><br class="">database is locked against ddl by another node<br class=""><br class="">I followed some guides to remove locks with these commands:<br class=""><br class="">SELECT * FROM pg_stat_activity;<br class="">SELECT pg_terminate_backend(${pid});<br class=""><br class="">But the issue is still there. Do you have an idea how to fix this issue?<br class=""><br class="">Thanks.<br class=""><br class=""></div></span></font></div></div></blockquote></div><br class=""></body></html>