1. 31 Oct, 2021 1 commit
  2. 30 Oct, 2021 4 commits
  3. 29 Oct, 2021 28 commits
    • Sergei Golubchik's avatar
      columnstore · 960b4870
      Sergei Golubchik authored
      960b4870
    • sjaakola's avatar
      MDEV-23328 Server hang due to Galera lock conflict resolution · ef2dbb8d
      sjaakola authored
      Mutex order violation when wsrep bf thread kills a conflicting trx,
      the stack is
      
                wsrep_thd_LOCK()
                wsrep_kill_victim()
                lock_rec_other_has_conflicting()
                lock_clust_rec_read_check_and_lock()
                row_search_mvcc()
                ha_innobase::index_read()
                ha_innobase::rnd_pos()
                handler::ha_rnd_pos()
                handler::rnd_pos_by_record()
                handler::ha_rnd_pos_by_record()
                Rows_log_event::find_row()
                Update_rows_log_event::do_exec_row()
                Rows_log_event::do_apply_event()
                Log_event::apply_event()
                wsrep_apply_events()
      
      and mutexes are taken in the order
      
                lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data
      
      When a normal KILL statement is executed, the stack is
      
                innobase_kill_query()
                kill_handlerton()
                plugin_foreach_with_mask()
                ha_kill_query()
                THD::awake()
                kill_one_thread()
      
              and mutexes are
      
                victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex
      
      This patch is the plan D variant for fixing potetial mutex locking
      order exercised by BF aborting and KILL command execution.
      
      In this approach, KILL command is replicated as TOI operation.
      This guarantees total isolation for the KILL command execution
      in the first node: there is no concurrent replication applying
      and no concurrent DDL executing. Therefore there is no risk of
      BF aborting to happen in parallel with KILL command execution
      either. Potential mutex deadlocks between the different mutex
      access paths with KILL command execution and BF aborting cannot
      therefore happen.
      
      TOI replication is used, in this approach,  purely as means
      to provide isolated KILL command execution in the first node.
      KILL command should not (and must not) be applied in secondary
      nodes. In this patch, we make this sure by skipping KILL
      execution in secondary nodes, in applying phase, where we
      bail out if applier thread is trying to execute KILL command.
      This is effective, but skipping the applying of KILL command
      could happen much earlier as well.
      
      This also fixed unprotected calls to wsrep_thd_abort
      that will use wsrep_abort_transaction. This is fixed
      by holding THD::LOCK_thd_data while we abort transaction.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      ef2dbb8d
    • Jan Lindström's avatar
      MDEV-25114: Crash: WSREP: invalid state ROLLED_BACK (FATAL) · d5bc0579
      Jan Lindström authored
      Revert "MDEV-23328 Server hang due to Galera lock conflict resolution"
      
      This reverts commit eac8341d.
      d5bc0579
    • Oleksandr Byelkin's avatar
      Merge branch '10.3' into 10.4 · 5900f3a7
      Oleksandr Byelkin authored
      5900f3a7
    • Oleksandr Byelkin's avatar
      Merge branch '10.2' into 10.3 · 6953af36
      Oleksandr Byelkin authored
      6953af36
    • Alexander Barkov's avatar
      MDEV-26732 Assertion `0' failed in Item::val_native · da4479ef
      Alexander Barkov authored
      add a test case
      da4479ef
    • Alexander Barkov's avatar
      6bf5a3be
    • Alexander Barkov's avatar
      MDEV-26742 Assertion `field->type_handler() == this' failed in... · 4300f502
      Alexander Barkov authored
      MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
      
      The bug was fixed in 10.5 using INET6 specific tests.
      
      This bugs adds only UUID specific tests (no code changes).
      4300f502
    • Alexander Barkov's avatar
      MDEV-26664 Store UUIDs in a more efficient manner · b9f19f7e
      Alexander Barkov authored
      UUID values
      
        llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn
      
      are now stored as
      
        nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll
      
      inside the record:
      
      - the groups (segments separated by dash) are reordered right-to-left.
      - the bytes inside the groups are not reordered (stored as before,
        in big-endian format).
      
      This provides a better sorting order: the earlier UUID was generated,
      the higher it appears in the ORDER BY output.
      
      Also, this change enables a good key prefix compression,
      because the constant part is now in the beginning, while
      the non-constant part (the timestamp) is in the end.
      b9f19f7e
    • Alexander Barkov's avatar
      Changing the FixedBinTypeBundle parameter to a "storage class" instead of sizes · 50bcda01
      Alexander Barkov authored
      - Adding a new template FixedBinTypeStorage.
      
      - Restoring classes UUID and Inet6
        as primitive "storage classes" for their data types.
        They derive from FixedBinTypeStorage.
        These storage classes have very few server dependencies so they
        can later be easily reused in smart engines, e.g. ColumnStore.
      
      - Changing the FixedBinTypeBundle parameter from
        <size_t NATIVE_LEN, size_t MAX_CHAR_LEN> to <class FbtImpl>
        and fixing UUID and INET6 bundles to get their storage
        classes as a parameter.
      50bcda01
    • Sergei Golubchik's avatar
      b1fab9bf
    • Alexander Barkov's avatar
      MDEV-4958 Adding datatype UUID · 7ab11f2b
      Alexander Barkov authored
      7ab11f2b
    • Sergei Golubchik's avatar
      cleanup: uuid · 72fb37ea
      Sergei Golubchik authored
      72fb37ea
    • Sergei Golubchik's avatar
      cleanup: move most of type_inet plugin implementation into the server · bdaa7fac
      Sergei Golubchik authored
      factor out the the common code for all plugin types that have a
      fixed-length native binary representation and a possibly variable-length
      string representation.
      bdaa7fac
    • Marko Mäkelä's avatar
      MDEV-26936 Recovery crash on rolling back DELETE FROM SYS_INDEXES · 003095e8
      Marko Mäkelä authored
      row_undo_mod_clust_low(): If we are in recovery and rolling back
      a DELETE operation on the SYS_INDEXES table, and the
      SYS_INDEXES.NAME starts with the magic byte 0xff
      that identifies uncommitted ADD INDEX stubs, we must not
      try to evict the table definition because such index stubs
      would be skipped by dict_load_indexes() anyway.
      003095e8
    • Marko Mäkelä's avatar
    • Vicențiu Ciorbaru's avatar
      MDEV-26242: Assertion `i >= 0' failed on setting default_tmp_storage_engine to 'DEFAULT' in 10.7 · 12eb8ad7
      Vicențiu Ciorbaru authored
      Locking / unlocking plugins is already handled by Sys_var_plugin::check
      method. No need to do that in the specialized checking code, use
      var->save_value instead to get the plugin handle.
      12eb8ad7
    • Oleksandr Byelkin's avatar
      columnstore-6.2.1-1 · ad3e416e
      Oleksandr Byelkin authored
      ad3e416e
    • Oleksandr Byelkin's avatar
      Merge branch '10.5' into 10.6 · facd9d52
      Oleksandr Byelkin authored
      facd9d52
    • Oleksandr Byelkin's avatar
      columnstore-5.6.3-2 · 1974df01
      Oleksandr Byelkin authored
      1974df01
    • Oleksandr Byelkin's avatar
      Merge branch '10.4' into 10.5 · 1c1396f0
      Oleksandr Byelkin authored
      1c1396f0
    • Marko Mäkelä's avatar
      MDEV-25683 Atomic DDL: With innodb_force_recovery=3 InnoDB: Trying to load... · dbd6c6dc
      Marko Mäkelä authored
      MDEV-25683 Atomic DDL: With innodb_force_recovery=3 InnoDB: Trying to load index but the index tree has been freed
      
      The purpose of the parameter innodb_force_recovery is to allow some
      data to be dumped from a corrupted database. Its values used to be
      as follows:
      
      innodb_force_recovery=0: normal (default)
      
      innodb_force_recovery=1: ignore (skip log for) corrupted pages or
      missing data files when applying the redo log
      
      innodb_force_recovery=2: additionally, disable background tasks
      (such as the purge of committed undo logs)
      
      innodb_force_recovery=3: additionally, disable the rollback of
      recovered incomplete (not committed or XA PREPARE) transactions
      
      innodb_force_recovery=4: same as 3 (since MDEV-19514 in MariaDB 10.5)
      
      innodb_force_recovery=5: additionally, do not process any undo log,
      disallow any writes, and force READ UNCOMMITTED isolation level
      
      innodb_force_recovery=6: additionally, pretend that ib_logfile0 does
      not exist (prevent any recovery). Never use this!
      
      The bad thing that happens with innodb_force_recovery=3 and
      innodb_force_recovery=4 is that also the rollback of any recovered
      DDL transaction will be skipped. This would break the DDL log recovery
      that was introduced in MDEV-17567.
      
      For one data directory sample, the DDL log recovery would hangs due to
      a conflict on the InnoDB SYS_TABLES table, because the lock holder
      transaction was not rolled back due to innodb_force_recovery=3.
      
      Fix: Make innodb_force_recovery=3 skip the DML transaction rollback only,
      and make innodb_force_recovery=4 (renamed to SRV_FORCE_NO_DDL_UNDO)
      behave like innodb_force_recovery=3 used to (skip the rollback of all
      recovered transactions, both DML and DDL).
      
      Startup with innodb_force_recovery=4 will be unaffected by this change.
      (There may be hangs, possibly preceded by messages about failing to
      load an index.)
      
      Side note: With innodb_force_recovery=5, any DDL log for InnoDB tables
      will be essentially ignored by InnoDB, but the server will start up.
      dbd6c6dc
    • sjaakola's avatar
      MDEV-23328 Server hang due to Galera lock conflict resolution · 157b3a63
      sjaakola authored
      Mutex order violation when wsrep bf thread kills a conflicting trx,
      the stack is
      
                wsrep_thd_LOCK()
                wsrep_kill_victim()
                lock_rec_other_has_conflicting()
                lock_clust_rec_read_check_and_lock()
                row_search_mvcc()
                ha_innobase::index_read()
                ha_innobase::rnd_pos()
                handler::ha_rnd_pos()
                handler::rnd_pos_by_record()
                handler::ha_rnd_pos_by_record()
                Rows_log_event::find_row()
                Update_rows_log_event::do_exec_row()
                Rows_log_event::do_apply_event()
                Log_event::apply_event()
                wsrep_apply_events()
      
      and mutexes are taken in the order
      
                lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data
      
      When a normal KILL statement is executed, the stack is
      
                innobase_kill_query()
                kill_handlerton()
                plugin_foreach_with_mask()
                ha_kill_query()
                THD::awake()
                kill_one_thread()
      
              and mutexes are
      
                victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex
      
      This patch is the plan D variant for fixing potetial mutex locking
      order exercised by BF aborting and KILL command execution.
      
      In this approach, KILL command is replicated as TOI operation.
      This guarantees total isolation for the KILL command execution
      in the first node: there is no concurrent replication applying
      and no concurrent DDL executing. Therefore there is no risk of
      BF aborting to happen in parallel with KILL command execution
      either. Potential mutex deadlocks between the different mutex
      access paths with KILL command execution and BF aborting cannot
      therefore happen.
      
      TOI replication is used, in this approach,  purely as means
      to provide isolated KILL command execution in the first node.
      KILL command should not (and must not) be applied in secondary
      nodes. In this patch, we make this sure by skipping KILL
      execution in secondary nodes, in applying phase, where we
      bail out if applier thread is trying to execute KILL command.
      This is effective, but skipping the applying of KILL command
      could happen much earlier as well.
      
      This also fixed unprotected calls to wsrep_thd_abort
      that will use wsrep_abort_transaction. This is fixed
      by holding THD::LOCK_thd_data while we abort transaction.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      157b3a63
    • Jan Lindström's avatar
      MDEV-25114: Crash: WSREP: invalid state ROLLED_BACK (FATAL) · 30337add
      Jan Lindström authored
      Revert "MDEV-23328 Server hang due to Galera lock conflict resolution"
      
      This reverts commit 29bbcac0.
      30337add
    • sjaakola's avatar
      MDEV-23328 Server hang due to Galera lock conflict resolution · 5c230b21
      sjaakola authored
      Mutex order violation when wsrep bf thread kills a conflicting trx,
      the stack is
      
                wsrep_thd_LOCK()
                wsrep_kill_victim()
                lock_rec_other_has_conflicting()
                lock_clust_rec_read_check_and_lock()
                row_search_mvcc()
                ha_innobase::index_read()
                ha_innobase::rnd_pos()
                handler::ha_rnd_pos()
                handler::rnd_pos_by_record()
                handler::ha_rnd_pos_by_record()
                Rows_log_event::find_row()
                Update_rows_log_event::do_exec_row()
                Rows_log_event::do_apply_event()
                Log_event::apply_event()
                wsrep_apply_events()
      
      and mutexes are taken in the order
      
                lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data
      
      When a normal KILL statement is executed, the stack is
      
                innobase_kill_query()
                kill_handlerton()
                plugin_foreach_with_mask()
                ha_kill_query()
                THD::awake()
                kill_one_thread()
      
              and mutexes are
      
                victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex
      
      This patch is the plan D variant for fixing potetial mutex locking
      order exercised by BF aborting and KILL command execution.
      
      In this approach, KILL command is replicated as TOI operation.
      This guarantees total isolation for the KILL command execution
      in the first node: there is no concurrent replication applying
      and no concurrent DDL executing. Therefore there is no risk of
      BF aborting to happen in parallel with KILL command execution
      either. Potential mutex deadlocks between the different mutex
      access paths with KILL command execution and BF aborting cannot
      therefore happen.
      
      TOI replication is used, in this approach,  purely as means
      to provide isolated KILL command execution in the first node.
      KILL command should not (and must not) be applied in secondary
      nodes. In this patch, we make this sure by skipping KILL
      execution in secondary nodes, in applying phase, where we
      bail out if applier thread is trying to execute KILL command.
      This is effective, but skipping the applying of KILL command
      could happen much earlier as well.
      
      This also fixed unprotected calls to wsrep_thd_abort
      that will use wsrep_abort_transaction. This is fixed
      by holding THD::LOCK_thd_data while we abort transaction.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      5c230b21
    • Jan Lindström's avatar
      MDEV-25114: Crash: WSREP: invalid state ROLLED_BACK (FATAL) · aa7ca987
      Jan Lindström authored
      Revert "MDEV-23328 Server hang due to Galera lock conflict resolution"
      
      This reverts commit eac8341d.
      aa7ca987
    • sjaakola's avatar
      MDEV-23328 Server hang due to Galera lock conflict resolution · db50ea3a
      sjaakola authored
      Mutex order violation when wsrep bf thread kills a conflicting trx,
      the stack is
      
                wsrep_thd_LOCK()
                wsrep_kill_victim()
                lock_rec_other_has_conflicting()
                lock_clust_rec_read_check_and_lock()
                row_search_mvcc()
                ha_innobase::index_read()
                ha_innobase::rnd_pos()
                handler::ha_rnd_pos()
                handler::rnd_pos_by_record()
                handler::ha_rnd_pos_by_record()
                Rows_log_event::find_row()
                Update_rows_log_event::do_exec_row()
                Rows_log_event::do_apply_event()
                Log_event::apply_event()
                wsrep_apply_events()
      
      and mutexes are taken in the order
      
                lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data
      
      When a normal KILL statement is executed, the stack is
      
                innobase_kill_query()
                kill_handlerton()
                plugin_foreach_with_mask()
                ha_kill_query()
                THD::awake()
                kill_one_thread()
      
              and mutexes are
      
                victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex
      
      This patch is the plan D variant for fixing potetial mutex locking
      order exercised by BF aborting and KILL command execution.
      
      In this approach, KILL command is replicated as TOI operation.
      This guarantees total isolation for the KILL command execution
      in the first node: there is no concurrent replication applying
      and no concurrent DDL executing. Therefore there is no risk of
      BF aborting to happen in parallel with KILL command execution
      either. Potential mutex deadlocks between the different mutex
      access paths with KILL command execution and BF aborting cannot
      therefore happen.
      
      TOI replication is used, in this approach,  purely as means
      to provide isolated KILL command execution in the first node.
      KILL command should not (and must not) be applied in secondary
      nodes. In this patch, we make this sure by skipping KILL
      execution in secondary nodes, in applying phase, where we
      bail out if applier thread is trying to execute KILL command.
      This is effective, but skipping the applying of KILL command
      could happen much earlier as well.
      
      This also fixed unprotected calls to wsrep_thd_abort
      that will use wsrep_abort_transaction. This is fixed
      by holding THD::LOCK_thd_data while we abort transaction.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      db50ea3a
    • Jan Lindström's avatar
      MDEV-25114: Crash: WSREP: invalid state ROLLED_BACK (FATAL) · c8b39f7e
      Jan Lindström authored
      Revert "MDEV-23328 Server hang due to Galera lock conflict resolution"
      
      This reverts commit 29bbcac0.
      c8b39f7e
  4. 28 Oct, 2021 7 commits