1. 17 May, 2017 3 commits
  2. 12 May, 2017 2 commits
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 03dca7a3
      Marko Mäkelä authored
      03dca7a3
    • Marko Mäkelä's avatar
      MDEV-12674 Innodb_row_lock_current_waits has overflow · ff166093
      Marko Mäkelä authored
      There is a race condition related to the variable
      srv_stats.n_lock_wait_current_count, which is only
      incremented and decremented by the function lock_wait_suspend_thread(),
      
      The incrementing is protected by lock_sys->wait_mutex, but the
      decrementing does not appear to be protected by anything.
      This mismatch could allow the counter to be corrupted when a
      transactional InnoDB table or record lock wait is terminating
      roughly at the same time with the start of a wait on a
      (possibly different) lock.
      
      ib_counter_t: Remove some unused methods. Prevent instantiation for N=1.
      Add an inc() method that takes a slot index as a parameter.
      
      single_indexer_t: Remove.
      
      simple_counter<typename Type, bool atomic=false>: A new counter wrapper.
      Optionally use atomic memory operations for modifying the counter.
      Aligned to the cache line size.
      
      lsn_ctr_1_t, ulint_ctr_1_t, int64_ctr_1_t: Define as simple_counter<Type>.
      These counters are either only incremented (and we do not care about
      losing some increment operations), or the increment/decrement operations
      are protected by some mutex.
      
      srv_stats_t::os_log_pending_writes: Document that the number is protected
      by log_sys->mutex.
      
      srv_stats_t::n_lock_wait_current_count: Use simple_counter<ulint, true>,
      that is, atomic inc() and dec() operations.
      
      lock_wait_suspend_thread(): Release the mutexes before incrementing
      the counters. Avoid acquiring the lock mutex if the lock wait has
      already been resolved. Atomically increment and decrement
      srv_stats.n_lock_wait_current_count.
      
      row_insert_for_mysql(), row_update_for_mysql(),
      row_update_cascade_for_mysql(): Use the inc() method with the trx->id
      as the slot index. This is a non-functional change, just using
      inc() instead of add(1).
      
      buf_LRU_get_free_block(): Replace the method add(index, n) with inc().
      There is no slot index in the simple_counter.
      ff166093
  3. 09 May, 2017 4 commits
  4. 08 May, 2017 5 commits
  5. 05 May, 2017 6 commits
  6. 03 May, 2017 1 commit
  7. 02 May, 2017 6 commits
  8. 30 Apr, 2017 3 commits
  9. 29 Apr, 2017 2 commits
  10. 28 Apr, 2017 2 commits
    • Sergei Golubchik's avatar
      Merge branch '10.0' 10.1 · e74f2e2b
      Sergei Golubchik authored
      e74f2e2b
    • Marko Mäkelä's avatar
      MDEV-12602 InnoDB: Failing assertion: space->n_pending_ops == 0 · b82c602d
      Marko Mäkelä authored
      This fixes a regression caused by MDEV-12428.
      When we introduced a variant of fil_space_acquire() that could
      increment space->n_pending_ops after space->stop_new_ops was set,
      the logic of fil_check_pending_operations() was broken.
      
      fil_space_t::n_pending_ios: A new field to track read or write
      access from the buffer pool routines immediately before a block
      write or after a block read in the file system.
      
      fil_space_acquire_for_io(), fil_space_release_for_io(): Similar
      to fil_space_acquire_silent() and fil_space_release(), but
      modify fil_space_t::n_pending_ios instead of fil_space_t::n_pending_ops.
      
      Adjust a number of places accordingly, and remove some redundant
      tablespace lookups.
      
      The following parts of this fix differ from the 10.2 version of this fix:
      
      buf_page_get_corrupt(): Add a tablespace parameter.
      
      In 10.2, we already had a two-phase process of freeing fil_space objects
      (first, fil_space_detach(), then release fil_system->mutex, and finally
      free the fil_space and fil_node objects).
      
      fil_space_free_and_mutex_exit(): Renamed from fil_space_free().
      Detach the tablespace from the fil_system cache, release the
      fil_system->mutex, and then wait for space->n_pending_ios to reach 0,
      to avoid accessing freed data in a concurrent thread.
      During the wait, future calls to fil_space_acquire_for_io() will
      not find this tablespace, and the count can only be decremented to 0,
      at which point it is safe to free the objects.
      
      fil_node_free_part1(), fil_node_free_part2(): Refactored from
      fil_node_free().
      b82c602d
  11. 27 Apr, 2017 6 commits