1. 09 Feb, 2014 1 commit
  2. 08 Feb, 2014 3 commits
    • unknown's avatar
      MDEV-5636: Deadlock in RESET MASTER · 07eaf6ea
      unknown authored
      The problem is a deadlock between MYSQL_BIN_LOG::reset_logs() and
      MYSQL_BIN_LOG::mark_xid_done(). The former takes LOCK_log and waits for the
      latter to complete. But the latter also tries to take LOCK_log; this can lead
      to a deadlock.
      
      There was already code that tries to deal with this, with the flag
      reset_master_pending. However, there was still a small opportunity for
      deadlock, when an previous mark_xid_done() is still running when reset_logs()
      is called and is at the precise point where it first releases LOCK_xid_list
      and then re-aquires both LOCK_log and LOCK_xid_list.
      
      Solve by setting reset_master_pending in reset_logs() before taking
      LOCK_log. And also count how many invocations of LOCK_xid_list are in the
      progress of releasing and re-aquiring locks, and in reset_logs() wait for that
      number to drop to zero after setting reset_master_pending and before taking
      LOCK_log.
      07eaf6ea
    • unknown's avatar
      MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID. · 76e929a9
      unknown authored
      Rewrite the gtid_waiting::wait_for_gtid() function.
      The code was rubbish (and buggy). Now the logic is
      much clearer.
      
      Also fix a missing slave sync that could cause test failure.
      76e929a9
    • unknown's avatar
      MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID. · 3c97d24f
      unknown authored
      Couple of small fixes following buildbot testing.
      3c97d24f
  3. 07 Feb, 2014 2 commits
    • unknown's avatar
      MDEV-4726: Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test · 7bb022f3
      unknown authored
      Some GTID test cases were using include/wait_condition.inc with a
      condition like SELECT COUNT(*)=4 FROM t1 to wait for the slave to
      catch up with the master. This causes races and test failures, as the
      changes to the tables become visible at the COMMIT of the SQL thread
      (or even before in case of MyISAM), but the changes to
      @@gtid_slave_pos only become visible a little bit after the COMMIT.
      
      Now that we have MASTER_GTID_WAIT(), just use that to sync up in a
      GTID-friendly way, wrapped in nice include/save_master_gtid.inc and
      include/sync_with_master_gtid.inc scripts.
      7bb022f3
    • unknown's avatar
      MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID. · 4e6606ac
      unknown authored
      MASTER_GTID_WAIT() is similar to MASTER_POS_WAIT(), but works with a
      GTID position rather than an old-style filename/offset.
      
      @@LAST_GTID gives the GTID assigned to the last transaction written
      into the binlog.
      
      Together, the two can be used by applications to obtain the GTID of
      an update on the master, and then do a MASTER_GTID_WAIT() for that
      position on any read slave where it is important to get results that
      are caught up with the master at least to the point of the update.
      
      The implementation of MASTER_GTID_WAIT() is implemented in a way
      that tries to minimise the performance impact on the SQL threads,
      even in the presense of many waiters on single GTID positions (as
      from @@LAST_GTID).
      4e6606ac
  4. 31 Jan, 2014 1 commit
  5. 07 Jan, 2014 1 commit
    • unknown's avatar
      Merge into 10.0-base: MDEV-5363, make parallel replication waits killable. · 90a76ff2
      unknown authored
      There are some places in parallel replication where transactions wait
      for one another. Make sure those waits are killable by the (super)user.
      
      Upon kill, unfinished transactions will be rolled back and the SQL thread
      stops with an error.
      
      Add a number of test cases to test the different cases. Also fix some
      existing bugs found by those tests.
      90a76ff2
  6. 06 Jan, 2014 1 commit
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · cee92518
      unknown authored
      Add another test case. This one for killing a query that is waiting
      for a prior commit, when --log-slave-updates=0 (in this case the
      wait happens in different code from --log-slave-updates=1).
      cee92518
  7. 03 Jan, 2014 1 commit
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · c4e76b20
      unknown authored
      Add another test case. This one for killing the SQL driver thread while it is
      waiting for room in the list of events queued for a worker thread.
      
      Fix bugs found:
      
       - Several memory leaks in various error cases.
      
       - SQL error code was not set (for SHOW SLAVE STATUS etc.) when killed.
      c4e76b20
  8. 19 Dec, 2013 1 commit
  9. 18 Dec, 2013 1 commit
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · 86a2c03b
      unknown authored
        
      Add another test case. This one for killing a worker while its transaction is
      waiting to start until the previous transaction has committed.
      
      Fix setting reading_or_writing to 0 in worker threads so SHOW SLAVE STATUS can
      show something more useful than "Reading from net".
      86a2c03b
  10. 17 Dec, 2013 6 commits
  11. 16 Dec, 2013 1 commit
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · f2c4765c
      unknown authored
      Fix locking bug / race introduced by previous patch: If we
      bail out of next_event() due to kill, there was a small window
      where we could exit without rli->data_lock held, causing an
      unlock-twice bug.
      f2c4765c
  12. 15 Dec, 2013 4 commits
  13. 13 Dec, 2013 2 commits
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · dbfe5f47
      unknown authored
      Add a test case for killing a waiting query in parallel replication.
      
      Fix several bugs found:
      
       - We should not wakeup_subsequent_commits() in ha_rollback_trans(), since we
         do not know the right wakeup_error() to give.
      
       - When a wait_for_prior_commit() is killed, we must unregister from the
         waitee so we do not race and get an extra (non-kill) wakeup.
      
       - We need to deal with error propagation correctly in queue_for_group_commit
         when one thread is killed.
      
       - Fix one locking issue in queue_for_group_commit(), we could unlock the
         waitee lock too early and this end up processing wakeup() with insufficient
         locking.
      
       - Fix Xid_log_event::do_apply_event; if commit fails it must not update the
         in-memory @@gtid_slave_pos state.
      
       - Fix and cleanup some things in the rpl_parallel.cc error handling.
      
       - Add a missing check for killed in the slave sql driver thread, to avoid a
         race.
      dbfe5f47
    • Sergei Golubchik's avatar
      5.3 merge · e68bccc7
      Sergei Golubchik authored
      e68bccc7
  14. 12 Dec, 2013 5 commits
  15. 11 Dec, 2013 2 commits
  16. 07 Dec, 2013 1 commit
  17. 06 Dec, 2013 2 commits
  18. 05 Dec, 2013 3 commits
    • Igor Babaev's avatar
      Merge · 21d0d8c5
      Igor Babaev authored
      21d0d8c5
    • Igor Babaev's avatar
      Fixed bug mdev-5382 · ccf5871d
      Igor Babaev authored
      When marking used columns the function find_field_in_table_ref() erroneously
      called the walk method for the real item behind a view/derived table field
      with the second parameter set to TRUE.
      This erroneous code was introduced in 2006. 
      ccf5871d
    • unknown's avatar
      MDEV-5363: Make parallel replication waits killable · 4d6ee2d1
      unknown authored
      Make wait_for_prior_commit killable, and handle the error if
      killed.
      4d6ee2d1
  19. 04 Dec, 2013 1 commit
  20. 03 Dec, 2013 1 commit