1. 25 Apr, 2021 1 commit
    • Marko Mäkelä's avatar
      MDEV-25512 Deadlock between sux_lock::u_x_upgrade() and sux_lock::u_lock() · b8138288
      Marko Mäkelä authored
      In the SUX_LOCK_GENERIC implementation, we can remember at most
      one pending exclusive lock request. If multiple exclusive lock
      requests are pending, the WRITER_WAITING flag will be cleared when
      the first waiting writer acquires the exclusive lock.
      
      ssux_lock_low::update_lock(): If WRITER_WAITING is set, wake up
      the writer even if the UPDATER flag is set, because the waiting
      writer may be in the process of upgrading its U lock to X.
      
      rw_lock::read_unlock(): Also indicate that an X lock waiter must
      be woken up if an U lock exists.
      
      This fix may cause unnecessary wake-ups and system calls, but this
      is the best that we can do. Ideally we would use the MDEV-25404
      idea of a separate 'writer' mutex, but there is no portable way to
      request that a non-recursive mutex be created, and InnoDB requires
      the ability to transfer buf_block_t::lock ownership to an I/O thread.
      
      To allow problems like this to be caught more reliably in the future,
      we add a unit test for srw_mutex, srw_lock, ssux_lock, sux_lock.
      b8138288
  2. 23 Apr, 2021 2 commits
  3. 22 Apr, 2021 12 commits
    • Marko Mäkelä's avatar
      Null-merge the revert of MDEV-24589 · bfc0110b
      Marko Mäkelä authored
      While MDEV-24589 causes the regression
      MDEV-25491 Race condition between DROP TABLE and purge of
      SYS_INDEXES record
      we must not revert it from 10.6, because MDEV-24589 is a prerequisite for
      MDEV-25180 Atomic ALTER TABLE
      that is targeting 10.6. The regression will be dealt with later.
      bfc0110b
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 18f35a86
      Marko Mäkelä authored
      18f35a86
    • Marko Mäkelä's avatar
      MDEV-25404 fixup: Fix ssux_lock_low::u_wr_upgrade() · 8121d03f
      Marko Mäkelä authored
      The U-to-X upgrade turned out to be incorrect. A debug assertion
      failed in wr_wait(), called from mtr_defer_drop_ahi() in a stress
      test with innodb_adaptive_hash_index=ON.
      
      A correct upgrade procedure ought to be readers.fetch_add(WRITER-1)
      to register ourselves as a WRITER (or waiting writer) and to release
      the reference that was being held for the U lock.
      
      Thanks to Matthias Leich for catching the problem.
      8121d03f
    • Marko Mäkelä's avatar
      Revert "MDEV-24589 DROP TABLE is not crash-safe" · 1636db54
      Marko Mäkelä authored
      This reverts commit e731a283.
      
      A crash occurred during the test stress.ddl_innodb when
      fil_delete_tablespace() for DROP TABLE was waiting in
      fil_check_pending_operations() and a purge thread for handling
      an earlier DROP INDEX was attempting to load the index root page
      in btr_free_if_exists() and btr_free_root_check(). The function
      buf_page_get_gen() would write out several times
      "trying to read...being-dropped tablespace"
      before giving up and committing suicide.
      
      It turns out that during any page access in btr_free_if_exists(),
      fil_space_t::set_stopping() could have been invoked by
      fil_check_pending_operations(), as part of dropping the tablespace.
      Preventing this race condition would require extensive changes
      to the allocation code or some locking mechanism that would ensure
      that we only set the flag if btr_free_if_exists() is not in progress.
      
      Either way, that could be a too risky change in a GA release.
      Because MDEV-24589 is not strictly necessary in the 10.5 release
      series and it only is a requirement for MDEV-25180 in a later
      major release, we will revert the change from 10.5.
      1636db54
    • sachin's avatar
      MDEV-22953 main.flush_read_lock failed in buildbot with XAER_NOTA: Unknown XID · 21973d0d
      sachin authored
      Issue:- Since there is no waiting for the actual disconnection of the con_tmp
      (which does XA prepare of test1), We can have a issue when test1 is not
      prepared and we are calling rollback on test1 , giving XAER_NOTA: Unknown XID
      error
      
      Solution:- Wait for the complete disconnection of con_tmp
      21973d0d
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 54c460ac
      Marko Mäkelä authored
      54c460ac
    • Marko Mäkelä's avatar
      fixup dd6ad380: remove dead code · b728c3db
      Marko Mäkelä authored
      b728c3db
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · df33b719
      Marko Mäkelä authored
      df33b719
    • Marko Mäkelä's avatar
      MDEV-25483: Shutdown crash during innodb.innodb_buffer_pool_resize_temporary · cbbca7ed
      Marko Mäkelä authored
      buf_resize_callback(): Correct an invalid assertion, and enable
      the assertion in debug builds only.
      
      Between buf_resize_start() and buf_resize_shutdown(),
      srv_shutdown_state must be less than SRV_SHUTDOWN_CLEANUP.
      
      The incorrect assertion had been introduced in
      commit 5e62b6a5 (MDEV-16264).
      As a result, the server could crash if shutdown was initiated
      concurrently with initiating a change of innodb_buffer_pool_size.
      cbbca7ed
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · ee455e6f
      Marko Mäkelä authored
      ee455e6f
    • Marko Mäkelä's avatar
      0d267f7c
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 6f271302
      Marko Mäkelä authored
      6f271302
  4. 21 Apr, 2021 25 commits