<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello,<br>
      The locking on these tables was implemented to prevent some
      deadlock situations we saw.<br>
      With Postgres, we run a SELECT ... FOR UPDATE command which locks
      the selected rows followed by an UPDATE. Then only the process
      that locked them can write to them. If another process does a
      similar command, it is possible for some of the same rows to be
      selected for locking, but in a different order. When two rows are
      locked in the opposite order, you end up with a deadlock.<br>
      The only solution we found was to lock the entire table for
      writing while the SELECT and UPDATE commands were run.<br>
      <br>
      Unfortunately, I'm not familiar with MySQL locks to say what might
      be appropriate in this case.<br>
      <br>
      Regards,<br>
      Hugh<br>
      <br>
      On 30/07/2013 05:22, Shane Harrison wrote:<br>
    </div>
    <blockquote
cite="mid:CAMHmU5jshqVXFe717QrUTEouM-P4m5g10=rJUyibraEBU7FngA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>Hi Peter,<br>
                      <br>
                    </div>
                    In thread:<br>
                    <a moz-do-not-send="true"
href="http://lists.kamailio.org/pipermail/sr-dev/2013-January/018347.html">http://lists.kamailio.org/pipermail/sr-dev/2013-January/018347.html</a><br>
                    you mentioned transaction support that you have
                    added to PostgreSQL driver. Unfortunately I do need
                    to use mysql as our HA solution is based on mysql
                    cluster.<br>
                  </div>
                  <br>
                </div>
                Hence I have implemented the required new functions e.g
                start_transaction.<br>
                <br>
              </div>
              However mysql only has one table locking mode (unlike
              PostgreSQL) and if you lock a table within a transaction,
              you can't read other tables without also obtaining locks
              for them as well.  As there are places where
              active_watchers table is locked but the code tries to
              query the watchers table, this is an issue.  I have simply
              disabled the table locking for the time being.<br>
              <br>
            </div>
            It is possible that the implicit transaction locking that
            mysql is enough to solve the issues you were trying to
            solve.  To determine this, can you tell me or point to a
            thread that explains what race conditions were trying to be
            mitigated in process_notifier mode.<br>
            <br>
          </div>
          Cheers and thanks<br>
        </div>
        Shane<br clear="all">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div><br>
                        -- <br>
                        <div>Imagination NZ Ltd<br>
                          Level 6 </div>
                        <div>92 Queens Drive<br>
                          P0 Box 30449<br>
                          Lower Hutt 5040<br>
                          <br>
                          +64 4 5703870 Extn 875<br>
                          +64 21 608919  (mobile)<br>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hugh Waite
Principal Design Engineer
Crocodile RCS Ltd.</pre>
  </body>
</html>