1. 11 Sep, 2015 2 commits
  2. 02 Sep, 2015 2 commits
    • Kristian Nielsen's avatar
      Fix a potential lost wakeup for binlog_commit_wait_usec · 09bfaf3a
      Kristian Nielsen authored
      If a transaction T1 needs to wait for a transaction T2, T2's commit will
      skip the normal binlog_commit_wait_usec delay, in order not to needlessly
      stall throughput.
      
      This works by checking if T2 is already ready to commit. If so, it is woken
      up. If not, we set a flag in T2 so that when it gets ready to commit, it
      will do so immediately.
      
      But there was a potential race due to insufficient locking, if T2 gets ready
      to commit just at the point where T1 does the check. If the race hits, the
      wakeup (and early commit) of T2 might be lost.
      
      The race is only theoretical (from code inspection, no known test case), but
      seems best to fix it anyway, by properly locking LOCK_prepare_ordered around
      the check.
      09bfaf3a
    • Kristian Nielsen's avatar
      MDEV-8725: Assertion `!(thd->rgi_slave && thd->... · 999c43ae
      Kristian Nielsen authored
      MDEV-8725: Assertion `!(thd->rgi_slave && thd-> rgi_slave->did_mark_start_commit)' failed in ha_rollback_trans
      
      The assertion is there to catch cases where we rollback while
      mark_start_commit() is active. This can allow following event groups
      to be replicated too early, causing conflicts.
      
      But in this case, we have an _explicit_ ROLLBACK event in the binlog,
      which should not assert.
      
      We fix this by delaying the mark_start_commit() in the explicit
      ROLLBACK case. It seems safest to delay this in ROLLBACK case anyway,
      and there should be no reason to try to optimise this corner case.
      999c43ae
  3. 04 Aug, 2015 2 commits
    • Kristian Nielsen's avatar
      Fix embedded server build · 5ca061e6
      Kristian Nielsen authored
      5ca061e6
    • Kristian Nielsen's avatar
      MDEV-8302: Duplicate key with parallel replication · 9b9c5e89
      Kristian Nielsen authored
      This bug is essentially another variant of MDEV-7458.
      
      If a transaction conflict caused a deadlock kill of T2 in record_gtid()
      during commit, the code would do a rollback _before_ running
      rgi->unmark_start_commit(). This creates a race where following transactions
      could start too early (before T2 has completed its transaction retry). This
      in turn could lead to replication failure, if there was a conflict that
      caused eg. duplicate key error or similar.
      
      The fix is to remove these rollbacks (in Query_log_event::do_apply_event()
      and Xid_log_event::do_apply_event(). They seem out-of-place; code in
      log_event.cc generally does not roll back on error, this is handled higher
      up.
      
      In addition, because of the extreme difficulty of reproducing bugs like
      MDEV-7458 and MDEV-8302, this patch adds some extra precations to try to
      detect (in debug builds) or prevent (in release builds) similar bugs.
      ha_rollback_trans() will now call unmark_start_commit() if needed (and
      assert in debug build when a caller does rollback without unmark first).
      
      We also add an extra check for thd->killed() so that we avoid doing
      mark_start_commit() if we already have a pending deadlock kill.
      
      And we add a missing unmark_start_commit() call in the error case, found by
      the above assertion.
      9b9c5e89
  4. 17 Jun, 2015 2 commits
  5. 16 Jun, 2015 18 commits
  6. 15 Jun, 2015 11 commits
  7. 14 Jun, 2015 3 commits