1. 28 Nov, 2018 1 commit
  2. 27 Nov, 2018 12 commits
  3. 26 Nov, 2018 11 commits
    • Marko Mäkelä's avatar
      MDEV-17816: Follow-up fix · 861038f2
      Marko Mäkelä authored
      When dropping a partially created table due to failure,
      use SQLCOM_TRUNCATE instead of SQLCOM_DROP_DB, so that
      no foreign key constraints will be touched. If any
      constraints were added as part of the creation, they would
      be reverted as part of the transaction rollback.
      
      We need an explicit call to row_drop_table_for_mysql(),
      because InnoDB does not do proper undo logging for CREATE TABLE,
      but would only drop the table at the end of the rollback.
      This would not work if the transaction combines both
      RENAME and CREATE, like TRUNCATE now does.
      861038f2
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 7dcbc33d
      Marko Mäkelä authored
      7dcbc33d
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 36359157
      Marko Mäkelä authored
      36359157
    • Marko Mäkelä's avatar
      MDEV-17831 Assertion `supports_instant()' failed in... · 8fe34dd4
      Marko Mäkelä authored
      MDEV-17831 Assertion `supports_instant()' failed in dict_table_t::prepare_instant upon ADD COLUMN on table with KEY_BLOCK_SIZE
      
      dict_table_t::prepare_instant(): Remove too strict assertions that
      could fail if the MariaDB and InnoDB data dictionaries are out of sync.
      
      That the dictionaries got out of sync during TRUNCATE TABLE
      is a separate bug was fixed in 10.2 by
      commit 971e1d86.
      8fe34dd4
    • Marko Mäkelä's avatar
      MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED · 971e1d86
      Marko Mäkelä authored
      If a table had a KEY_BLOCK_SIZE attribute, but no ROW_FORMAT,
      it would be created as ROW_FORMAT=COMPRESSED in InnoDB.
      However, TRUNCATE TABLE would lose the KEY_BLOCK_SIZE attribute
      and create the table with the innodb_default_row_format (DYNAMIC).
      
      This is a regression that was introduced by MDEV-13564.
      
      update_create_info_from_table(): Copy also KEY_BLOCK_SIZE.
      971e1d86
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1afed207
      Marko Mäkelä authored
      The test galera_sst_mariabackup_table_options was disabled,
      because the server refuses to start up due to wrong parameters.
      1afed207
    • Jan Lindström's avatar
      9669536c
    • Marko Mäkelä's avatar
      MDEV-17816 Crash in TRUNCATE TABLE when table creation fails · 2a31b828
      Marko Mäkelä authored
      The error handling in the MDEV-13564 TRUNCATE TABLE was broken
      when an error occurred during table creation.
      
      row_create_index_for_mysql(): Do not drop the table on error.
      
      fts_create_one_common_table(), fts_create_one_index_table():
      Do drop the table on error.
      
      create_index(), create_table_info_t::create_table():
      Let the caller handle the index creation errors.
      
      ha_innobase::create(): If create_table_info_t::create_table()
      fails, drop the incomplete table, roll back the transaction,
      and finally return an error to the caller.
      2a31b828
    • Daniel Black's avatar
      travis: xcode10.1 · 06972b2f
      Daniel Black authored
      06972b2f
    • Marko Mäkelä's avatar
      MDEV-14409 Assertion `page_rec_is_leaf(rec)' failed in lock_rec_validate_page · a81fceaf
      Marko Mäkelä authored
      lock_rec_queue_validate(): Assert page_rec_is_leaf(rec), except when
      the record is a page infimum or supremum.
      
      lock_rec_validate_page(): Relax the assertion that failed.
      The assertion was reachable when the record lock bitmap was empty.
      
      lock_rec_insert_check_and_lock(): Assert page_is_leaf().
      a81fceaf
    • Alexander Barkov's avatar
  4. 23 Nov, 2018 2 commits
    • Marko Mäkelä's avatar
      27f3329f
    • Marko Mäkelä's avatar
      MDEV-17813 Crash in instant ALTER TABLE due to purge concurrently emptying table · 2c4844c9
      Marko Mäkelä authored
      Several race conditions between MDEV-15562 instant ALTER TABLE and purge
      were observed.
      
      The most obvious race condition resulted in a reported assertion failure in
      dict_index_t::instant_add_field(): instant.n_core_fields == n_core_fields
      would not hold if the table was emptied by purge after the time
      dict_table_t::prepare_instant() was called.
      
      During purge, it can turn out that the table is logically empty, only
      containing a metadata record. If the metadata record is of the type
      created by MDEV-11369 instant ADD COLUMN, it can be removed and
      dict_index_t::clear_instant_add() can be called. This will convert the
      table to the canonical non-instant format. (If the metadata record is
      of the MDEV-15562 type, then it can only be deleted if the table becomes
      empty as the result of rollback of an instant ALTER TABLE operation.)
      
      row_purge_remove_clust_if_poss_low(): Add a debug check that ensures
      that purge can never remove a MDEV-15562 metadata record.
      
      ha_innobase::open(): Add a comment about the necessity of rolling
      back any recovered instant ALTER TABLE transaction on the table.
      
      instant_metadata_lock(): An auxiliary function to acquire a page latch
      on the metadata record, to prevent race conditions.
      
      dict_table_t::prepare_instant(), dict_index_t::instant_add_field(),
      dict_table_t::rollback_instant(), innobase_instant_try():
      Invoke instant_metadata_lock() in order to prevent race conditions.
      
      dict_index_t::instant_add_field(): Correct debug assertions.
      The == was guaranteed by code in dict_table_t::prepare_instant()
      that was introduced in MDEV-15562. Due to the race condition,
      we could occasionally have <=, but never >= like the code was
      after MDEV-11369.
      
      ha_innobase_inplace_ctx::instant_column(): Wrapper for
      dict_table_t::instant_column(). Add debug assertions.
      2c4844c9
  5. 22 Nov, 2018 11 commits
    • Marko Mäkelä's avatar
      Fix the -DWITH_WSREP:BOOL=OFF build · 46a41108
      Marko Mäkelä authored
      46a41108
    • Marko Mäkelä's avatar
      MDEV-12266: Remove a level of pointer indirection · 06e5f28f
      Marko Mäkelä authored
      Replace table->space->id with table->space_id.
      06e5f28f
    • Jan Lindström's avatar
      MDEV-17804: Galera tests cause mysql_socket.h:738: inline_mysql_socket_send:... · 3728b11f
      Jan Lindström authored
      MDEV-17804: Galera tests cause mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
      
      Do not do end of statement logic if thd is already killed as
      socket is already closed.
      3728b11f
    • Jan Lindström's avatar
      MDEV-17801: Galera test failure on galera_var_reject_queries · dde0a83f
      Jan Lindström authored
      Problem was that controlling connection i.e. connection that
      executed the query SET GLOBAL wsrep_reject_queries = ALL_KILL;
      was also killed but server would try to send result from that
      query to controlling connection resulting a assertion
      mysqld: /home/jan/mysql/10.2-sst/include/mysql/psi/mysql_socket.h:738: inline_mysql_socket_send: Assertion `mysql_socket.fd != -1' failed.
      as socket was closed when controlling connection was closed.
      
      wsrep_close_client_connections()
      	Do not close controlling connection and instead of
      	wsrep_close_thread() we do now soft kill by THD::awake
      
      wsrep_reject_queries_update()
      	Call wsrep_close_client_connections using current thd.
      dde0a83f
    • Jan Lindström's avatar
      MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup · 2b49e156
      Jan Lindström authored
      Disable galera_3nodes tests using xtrabackup.
      2b49e156
    • Jan Lindström's avatar
      MDEV-15522: Change galera suite MTR tests to use mariabackup instead of xtrabackup · 00c88a71
      Jan Lindström authored
      Disable galera tests using xtrabackup.
      00c88a71
    • Jan Lindström's avatar
      MDEV-17771: Add Galera ist and sst tests using mariabackup · 4b1b4b39
      Jan Lindström authored
      Record result files for 10.2.
      4b1b4b39
    • Marko Mäkelä's avatar
      MDEV-17794 Do not assign persistent ID for temporary tables · 4be0855c
      Marko Mäkelä authored
      InnoDB in MySQL 5.7 introduced two new parameters to the function
      dict_hdr_get_new_id(), to allow redo logging to be disabled when
      assigning identifiers to temporary tables or during the
      backup-unfriendly TRUNCATE TABLE that was replaced in MariaDB
      by MDEV-13564.
      
      Now that MariaDB 10.4.0 removed the crash recovery code for the
      backup-unfriendly TRUNCATE, we can revert dict_hdr_get_new_id()
      to be used only for persistent data structures.
      
      dict_table_assign_new_id(): Remove. This was a simple 2-line function
      that was called from few places.
      
      dict_table_open_on_id_low(): Declare in the only file where it
      is called.
      
      dict_sys_t::temp_id_hash: A separate lookup table for temporary tables.
      Table names will be in the common dict_sys_t::table_hash.
      
      dict_sys_t::get_temporary_table_id(): Assign a temporary table ID.
      
      dict_sys_t::get_table(): Look up a persistent table.
      
      dict_sys_t::get_temporary_table(): Look up a temporary table.
      
      dict_sys_t::temp_table_id: The sequence of temporary table identifiers.
      Starts from DICT_HDR_FIRST_ID, so that we can continue to simply compare
      dict_table_t::id to a few constants for the persistent hard-coded
      data dictionary tables.
      
      undo_node_t::state: Distinguish temporary and persistent tables.
      
      lock_check_dict_lock(), lock_get_table_id(): Assert that there cannot
      be locks on temporary tables.
      
      row_rec_to_index_entry_impl(): Assert that there cannot be metadata
      records on temporary tables.
      
      row_undo_ins_parse_undo_rec(): Distinguish temporary and persistent tables.
      Move some assertions from the only caller. Return whether the table was
      found.
      
      row_undo_ins(): Add some assertions.
      
      row_undo_mod_clust(), row_undo_mod(): Do not assign node->state.
      Let row_undo() do that.
      
      row_undo_mod_parse_undo_rec(): Distinguish temporary and persistent tables.
      Move some assertions from the only caller. Return whether the table was
      found.
      
      row_undo_try_truncate(): Renamed and simplified from trx_roll_try_truncate().
      
      row_undo_rec_get(): Replaces trx_roll_pop_top_rec_of_trx() and
      trx_roll_pop_top_rec(). Fetch an undo log record, and assign undo->state
      accordingly.
      
      trx_undo_truncate_end(): Acquire the rseg->mutex only for the minimum
      required duration, and release it between mini-transactions.
      4be0855c
    • Marko Mäkelä's avatar
      23ff318d
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-17793 Crash in purge after instant DROP and emptying the table · 2ebb110c
      Marko Mäkelä authored
      There was a race condition between ALTER TABLE and purge.
      
      If a table turns out to be logically empty when instant ALTER TABLE
      is executing, we will convert the table to the canonical format,
      to avoid overhead during subsequent accesses, and to allow the
      data file to be imported into older versions of MariaDB.
      
      It could happen that at the time the table is logically empty,
      there still exists an undo log record for updating the hidden
      metadata record for an earlier instant ALTER TABLE operation.
      If the table was converted to the canonical format before
      purge processes this undo log record, the undo log record
      could be referring to index fields that no longer exist,
      causing a crash.
      
      To prevent the race condition, we must delete the old undo log records.
      We do this lazily by assigning a new table ID, so that the table lookup
      for the old undo log records will fail.
      
      dict_table_t::reassign_id(): Reassign the table_id to
      effectively lazily delete old undo log records.
      
      innobase_instant_try(): Invoke index->table->reassign_id() before
      index->clear_instant_alter().
      2ebb110c
  6. 21 Nov, 2018 3 commits