<div dir="auto">Fredrick, no, that is a very bad idea.<div dir="auto"><br></div><div dir="auto">Mike was rwferring to disable the freeswitch feature that manage the db schema (eg, drop and create tables) at startup.</div><div dir="auto"><br></div><div dir="auto">This can be configured in vars.conf.xml or in some other xml config file, near where you config the dsn to access the db.</div><div dir="auto"><br></div><div dir="auto">So, freeswitch will not emit ddl commands.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 29, 2019, 06:54 Frédérick Pruneau <<a href="mailto:frederick@targointernet.com">frederick@targointernet.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Thanks for your help.</p>
    <p>I have found this to remove DDL locks and it works. I don't know
      if it is a good way:</p>
    <p>SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE
      datname = 'freeswitch';</p>
    <p>ALTER ROLE $db_user SET bdr.permit_ddl_locking = false;</p>
    <p>I will check to disable schema management features.<br>
    </p>
    <div class="m_-2671393417747068951moz-cite-prefix">Le 19-05-10 à 16 h 26, Mike Jerris a
      écrit :<br>
    </div>
    <blockquote type="cite">
      
      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>
      <div><br>
        <blockquote type="cite">
          <div>On May 10, 2019, at 5:45 AM, Praveen Chourasia
            <<a href="mailto:praveen.chourasia@outlook.com" target="_blank" rel="noreferrer">praveen.chourasia@outlook.com</a>>
            wrote:</div>
          <br class="m_-2671393417747068951Apple-interchange-newline">
          <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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt">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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt"><br>
            </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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt">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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt"><br>
            </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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt">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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt"><br>
            </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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt">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;text-decoration:none;font-family:Calibri,Helvetica,sans-serif;font-size:10pt"><br>
            </div>
            <div id="m_-2671393417747068951Signature" style="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;text-decoration:none">
              <div id="m_-2671393417747068951divtagdefaultwrapper" dir="ltr" style="font-size:10pt;font-family:Calibri,Arial,Helvetica,sans-serif"><font style="font-size:10pt" size="2" face="Calibri" color="#5133ab">--</font>
                <div><font style="font-size:10pt" size="2" face="Calibri" color="#5133ab"><font style="font-size:10pt" face="Calibri" color="#5133ab"><b>Praveen Chourasia</b><br>
                    </font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:13.3333px"></span>
                    <div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:13.3333px"><br>
                    </div>
                  </font>
                  <div><span style="font-family:Calibri;font-size:10pt"></span></div>
                </div>
              </div>
            </div>
            <hr style="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;text-decoration:none;display:inline-block;width:842.796875px"><span style="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;text-decoration:none;float:none;display:inline!important"></span>
            <div id="m_-2671393417747068951divRplyFwdMsg" dir="ltr" style="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;text-decoration:none"><font style="font-size:11pt" face="Calibri, sans-serif"><b>From:</b><span class="m_-2671393417747068951Apple-converted-space"> </span>FreeSWITCH-users
                <<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank" rel="noreferrer">freeswitch-users-bounces@lists.freeswitch.org</a>>
                on behalf of Frédérick Pruneau <<a href="mailto:frederick@targointernet.com" target="_blank" rel="noreferrer">frederick@targointernet.com</a>><br>
                <b>Sent:</b><span class="m_-2671393417747068951Apple-converted-space"> </span>Monday,
                May 6, 2019 7:38 PM<br>
                <b>To:</b><span class="m_-2671393417747068951Apple-converted-space"> </span><a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank" rel="noreferrer">freeswitch-users@lists.freeswitch.org</a><br>
                <b>Subject:</b><span class="m_-2671393417747068951Apple-converted-space"> </span>[Freeswitch-users]
                FS can't reconnect to PostgreSQL database</font>
              <div> </div>
            </div>
            <div class="m_-2671393417747068951BodyFragment" style="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;text-decoration:none"><font size="2"><span style="font-size:11pt">
                  <div class="m_-2671393417747068951PlainText">Hi guys,<br>
                    <br>
                    I have an issue with FS unable to reconnect to
                    postgresql database. Here<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    is the setup: 2 FreeSWITCH servers with 2 postgresql
                    servers. Each<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    freeswitch is connected to 1 postgresql server. DB
                    servers are synced<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    with BDR. It was working very well until I restarted
                    freeswitch service<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    on one of the servers. Then, I got theses errors
                    showing up on<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    freeswitch console:<br>
                    <br>
                    switch_pgsql.c:384 Query X took too long to complete
                    or database not<span class="m_-2671393417747068951Apple-converted-space"> </span><br>
                    responding.<br>
                    <br>
                    database is locked against ddl by another node<br>
                    <br>
                    I followed some guides to remove locks with these
                    commands:<br>
                    <br>
                    SELECT * FROM pg_stat_activity;<br>
                    SELECT pg_terminate_backend(${pid});<br>
                    <br>
                    But the issue is still there. Do you have an idea
                    how to fix this issue?<br>
                    <br>
                    Thanks.<br>
                    <br>
                  </div>
                </span></font></div>
          </div>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="m_-2671393417747068951mimeAttachmentHeader"></fieldset>
      <pre class="m_-2671393417747068951moz-quote-pre">_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire <a class="m_-2671393417747068951moz-txt-link-freetext" href="https://signalwire.com" target="_blank" rel="noreferrer">https://signalwire.com</a>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time <a class="m_-2671393417747068951moz-txt-link-freetext" href="https://signalwire.community" target="_blank" rel="noreferrer">https://signalwire.community</a>

Professional FreeSWITCH Services
<a class="m_-2671393417747068951moz-txt-link-abbreviated" href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a>
<a class="m_-2671393417747068951moz-txt-link-freetext" href="https://freeswitch.com" target="_blank" rel="noreferrer">https://freeswitch.com</a>

Official FreeSWITCH Sites
<a class="m_-2671393417747068951moz-txt-link-freetext" href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a>
<a class="m_-2671393417747068951moz-txt-link-freetext" href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a>
<a class="m_-2671393417747068951moz-txt-link-freetext" href="https://cluecon.com" target="_blank" rel="noreferrer">https://cluecon.com</a>

FreeSWITCH-users mailing list
<a class="m_-2671393417747068951moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="m_-2671393417747068951moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="m_-2671393417747068951moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="m_-2671393417747068951moz-txt-link-freetext" href="https://freeswitch.com" target="_blank" rel="noreferrer">https://freeswitch.com</a></pre>
    </blockquote>
    <div class="m_-2671393417747068951moz-signature">-- <br>
      <table style="width:550px" cellspacing="0" cellpadding="0" border="0">
        <tbody>
          <tr>
            <td>
              <table style="border-collapse:collapse" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                  <tr>
                    <td style="width:237px"><img src="http://www.targo.ca/signatures/signature-targo-2019_04.gif" alt="" border="0"></td>
                    <td><font face="arial" color="#339933"><b>Frédérick
                          Pruneau </b></font><font face="arial" color="#333333">| Spécialiste VoIP<br>
                        <br>
                        <b>T </b> 514.448.0773 <b> #</b> 121<br>
                        <b>E </b> <a class="m_-2671393417747068951moz-txt-link-abbreviated" href="mailto:frederick@targointernet.com" target="_blank" rel="noreferrer">frederick@targointernet.com</a><br>
                      </font></td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td height="28">
              <table style="border-collapse:collapse" cellspacing="0" cellpadding="0" border="0">
                <tbody>
                  <tr>
                    <td style="width:510px;height:28px" align="right">
                      <div style="font-size:2px">
                        <a href="http://www.targo.ca" target="_blank" rel="noreferrer"><img src="http://www.targo.ca/signatures/signature-targo-2019_06.gif" alt="" border="0"></a></div>
                    </td>
                    <td style="width:39px" align="left">
                      <div style="font-size:2px"><a href="https://fr-ca.facebook.com/pages/category/Local-Business/Targo-Communications-176964412324634/" target="_blank" rel="noreferrer"><img src="http://www.targo.ca/signatures/signature-targo-2019_07.gif" alt="" border="0"></a></div>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td style="width:550px;height:127px" width="549" height="127"><a href="https://goo.gl/maps/MQtJ4S3rYLP537ss7" target="_blank" rel="noreferrer"><img src="http://www.targo.ca/signatures/signature-targo-2019_08.gif" alt="" border="0" align="top"></a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>

_________________________________________________________________________<br>
<br>
The FreeSWITCH project is sponsored by SignalWire <a href="https://signalwire.com" rel="noreferrer noreferrer" target="_blank">https://signalwire.com</a><br>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br>
Build your next product on our scalable cloud platform.<br>
<br>
Join our online community to chat in real time <a href="https://signalwire.community" rel="noreferrer noreferrer" target="_blank">https://signalwire.community</a><br>
<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>