1. 24 May, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-31234 fixup: Free some UNDO pages earlier · c5cf94b2
      Marko Mäkelä authored
      trx_purge_truncate_rseg_history(): Add a parameter to specify if
      the entire rollback segment is safe to be freed. If not, we may
      still be able to invoke trx_undo_truncate_start() and free some pages.
      c5cf94b2
  2. 19 May, 2023 1 commit
    • Marko Mäkelä's avatar
      MDEV-31234 InnoDB does not free UNDO after the fix of MDEV-30671 · e0084b9d
      Marko Mäkelä authored
      trx_purge_truncate_history(): Only call trx_purge_truncate_rseg_history()
      if the rollback segment is safe to process. This will avoid leaking undo
      log pages that are not yet ready to be processed. This fixes a regression
      that was introduced in
      commit 0de3be8c (MDEV-30671).
      
      trx_sys_t::any_active_transactions(): Separately count XA PREPARE
      transactions.
      
      srv_purge_should_exit(): Terminate slow shutdown if the history size
      does not change and XA PREPARE transactions exist in the system.
      This will avoid a hang of the test innodb.recovery_shutdown.
      
      Tested by: Matthias Leich
      e0084b9d
  3. 05 May, 2023 2 commits
    • Oleksandr Byelkin's avatar
      Merge branch '10.4' into 10.5 · b735ca47
      Oleksandr Byelkin authored
      b735ca47
    • Sergei Petrunia's avatar
      MDEV-31194: Server crash or assertion failure with join_cache_level=4 · 2594da7a
      Sergei Petrunia authored
      The problem, introduced in patch for MDEV-26301:
      
      When check_join_cache_usage() decides not to use join buffer, it must
      adjust the access method accordingly. For BNL-H joins this means switching
      from pseudo-"ref access"(with index=MAX_KEY) to some other access method.
      
      Failing to do this will cause assertions down the line when code that is
      not aware of BNL-H will try to initialize index use for ref access with
      index=MAX_KEY.
      
      The fix is to follow the regular code path to disable the join buffer for
      the join_tab ("goto no_join_cache") instead of just returning from
      check_join_cache_usage().
      2594da7a
  4. 04 May, 2023 7 commits
  5. 03 May, 2023 7 commits
  6. 02 May, 2023 11 commits
  7. 29 Apr, 2023 2 commits
  8. 28 Apr, 2023 6 commits
  9. 27 Apr, 2023 3 commits
    • Andrei's avatar
      MDEV-29621: Replica stopped by locks on sequence · 55a53949
      Andrei authored
      When using binlog_row_image=FULL with sequence table inserts, a
      replica can deadlock because it treats full inserts in a sequence as DDL
      statements by getting an exclusive lock on the sequence table. It
      has been observed that with parallel replication, this exclusive
      lock on the sequence table can lead to a deadlock where one
      transaction has the exclusive lock and is waiting on a prior
      transaction to commit, whereas this prior transaction is waiting on
      the MDL lock.
      
      This fix for this is on the master side, to raise FL_DDL
      flag on the GTID of a full binlog_row_image write of a sequence table.
      This forces the slave to execute the statement serially so a deadlock
      cannot happen.
      
      A test verifies the deadlock also to prove it happen on the OLD (pre-fixes)
      slave.
      
      OLD (buggy master) -replication-> NEW (fixed slave) is provided.
      As the pre-fixes master's full row-image may represent both
      SELECT NEXT VALUE and INSERT, the parallel slave pessimistically
      waits for the prior transaction to have committed before to take on the
      critical part of the second (like INSERT in the test) event execution.
      The waiting exploits a parallel slave's retry mechanism which is
      controlled by `@@global.slave_transaction_retries`.
      
      Note that in order to avoid any persistent 'Deadlock found' 2013 error
      in OLD -> NEW, `slave_transaction_retries` may need to be set to a
      higher than the default value.
      START-SLAVE is an effective work-around if this still happens.
      55a53949
    • Sergei Golubchik's avatar
    • Oleksandr Byelkin's avatar
      a959c22e