1. 08 Dec, 2017 14 commits
    • Marko Mäkelä's avatar
      Remove space_name_list_t · 39450498
      Marko Mäkelä authored
      fil_get_space_names(): Remove.
      
      fts_drop_orphaned_tables(): Iterate fil_system->space_list directly.
      39450498
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 094b0f86
      Marko Mäkelä authored
      094b0f86
    • Vladislav Vaintroub's avatar
      Fix warnings · bf963106
      Vladislav Vaintroub authored
      bf963106
    • Monty's avatar
      Fix failing mtr tests · 38908aaf
      Monty authored
      - Changed rocksdb.2pcgroup_commit.test to print information on error
      - Updated myisam_views-big.result
      38908aaf
    • Monty's avatar
      Move all kill mutex protection to LOCK_thd_kill · c2118a08
      Monty authored
      LOCK_thd_data was used to protect both THD data and
      ensure that the THD is not deleted while it was in use
      
      This patch moves the THD delete protection to LOCK_thd_kill,
      which already protects the THD for kill.
      
      The benefits are:
      - More well defined what LOCK_thd_data protects
      - LOCK_thd_data usage is now much simpler and easier to verify
      - Less chance of deadlocks in SHOW PROCESS LIST as there is less
        chance of interactions between mutexes
      - Remove not needed LOCK_thread_count from
        thd_get_error_context_description()
      - Fewer mutex taken for thd->awake()
      
      Other things:
      - Don't take mysys->var mutex in show processlist to check if thread
        is kill marked
      - thd->awake() now automatically takes the LOCK_thd_kill mutex
        (Simplifies code)
      - Apc uses LOCK_thd_kill instead of LOCK_thd_data
      c2118a08
    • Monty's avatar
      Updated MW-388.result file · 3574f9c7
      Monty authored
      3574f9c7
    • Monty's avatar
      Don't wait too long in SHOW PROCESSLIST · 7891a713
      Monty authored
      This will allow show processlist to continue, without blocking
      all new connections, if some threads gets stuck while holding
      LOCK_thd_data or mysys_var->mutex
      
      Connections that has mutex 'stuck' are marked as 'Busy' in 'Command'
      
      Todo:
      Make F_BACKOFF to do 'pause' instead of just (1)
      7891a713
    • Sergey Vojtovich's avatar
      Restore LF_BACKOFF · b3346c2f
      Sergey Vojtovich authored
      Moved InnoDB UT_RELAX_CPU() to server. Restored cross-platform LF_BACKOFF
      implementation basing on UT_RELAX_CPU().
      b3346c2f
    • Jan Lindström's avatar
      Fix test failures. · 2662228d
      Jan Lindström authored
      2662228d
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-14378 In ALGORITHM=INPLACE, use a common name for the intermediate tables or partitions · 07e9ff1f
      Marko Mäkelä authored
      Allow DROP TABLE `#mysql50##sql-...._.` to drop tables that were
      being rebuilt by ALGORITHM=INPLACE
      
      NOTE: If the server is killed after the table-rebuilding ALGORITHM=INPLACE
      commits inside InnoDB but before the .frm file has been replaced, then
      the recovery will involve something else than DROP TABLE.
      
      NOTE: If the server is killed in a true inplace ALTER TABLE commits
      inside InnoDB but before the .frm file has been replaced, then we
      are really out of luck. To properly handle that situation, we would
      need a transactional mysql.ddl_fixup table that directs recovery to
      rename or remove files.
      
      prepare_inplace_alter_table_dict(): Use the altered_table->s->table_name
      for generating the new_table_name.
      
      table_name_t::part_suffix: The start of the partition name suffix.
      
      table_name_t::dbend(): Return the end of the schema name.
      
      table_name_t::dblen(): Return the length of the schema name, in bytes.
      
      table_name_t::basename(): Return the name without the schema name.
      
      table_name_t::part(): Return the partition name, or NULL if none.
      
      row_drop_table_for_mysql(): Assert for #sql, not #sql-ib.
      07e9ff1f
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 0a02c1a6
      Marko Mäkelä authored
      0a02c1a6
    • Marko Mäkelä's avatar
      MDEV-14606 Assertion failure on IMPORT TABLESPACE · dfafe15a
      Marko Mäkelä authored
      fseg_alloc_free_page_low(): Remove a bogus and redundant assertion about
      fil_space_t::purpose. The debug function fsp_space_modify_check()
      is asserting something similar, but more accurately.
      dfafe15a
    • Alexander Barkov's avatar
  2. 07 Dec, 2017 10 commits
    • Sergei Petrunia's avatar
      MDEV-14607: storage_engine-rocksdb.type_bit_indexes fails after latest pushes · 578b2659
      Sergei Petrunia authored
      Update the .result file. Old EXPLAIN output was incorrect due to
      hitting MDEV-14563.
      578b2659
    • Alexander Barkov's avatar
      08dae447
    • Jan Lindström's avatar
      4d016e6e
    • Jan Lindström's avatar
      MDEV-14401: Stored procedure that declares a handler that catches... · ba576c5b
      Jan Lindström authored
      MDEV-14401: Stored procedure that declares a handler that catches ER_LOCK_DEADLOCK error causes thd->is_error() assertion
      
      This was missing bug fix from MySQL wsrep i.e. Galera.
      Problem was that if stored procedure declares a handler that
      catches deadlock error, then the error may have been
      cleared in method sp_rcontext::handle_sql_condition().
      Use wsrep_conflict_state correctly to determine is the
      error already sent to client.
      
      Add test case for both this bug and MDEV-12837: WSREP: BF
      lock wait long. Test requires both fixes to pass.
      ba576c5b
    • Jan Lindström's avatar
      MDEV-12837: WSREP: BF lock wait long · da3a3a68
      Jan Lindström authored
      Problem was a merge error from MySQL wsrep i.e. Galera.
      
      wsrep_on_check
      	New check function. Galera can't be enabled
      	if innodb-lock-schedule-algorithm=VATS.
      
      innobase_kill_query
      	In Galera async kill we could own lock mutex.
      
      innobase_init
      	If Variance-Aware-Transaction-Sheduling Algorithm (VATS) is
      	used on Galera we fall back to First-Come-First-Served (FCFS)
      	with notice to user.
      
      Changed innodb-lock-schedule-algorithm as read-only parameter
      as it was designed to be.
      
      lock_reset_lock_and_trx_wait
      	Use ib::hex() to print out transaction ID.
      
      lock_rec_other_has_expl_req,
      lock_rec_other_has_conflicting,
      RecLock::add_to_waitq
      lock_rec_lock_slow
      lock_table_other_has_incompatible
      lock_rec_insert_check_and_lock
      lock_prdt_other_has_conflicting
      
      	Change pointer to conflicting lock to normal pointer as this
      	pointer contents could be changed later.
      
      RecLock::create
      	Conclicting lock pointer is moved to last parameter with
      	default value NULL. This conflicting transaction could
      	be selected as victim in Galera if requesting transaction
      	is BF (brute force) transaction. In this case contents
      	of conflicting lock pointer will be changed. Use ib::hex() to print
      	transaction ids.
      da3a3a68
    • Monty's avatar
      Fix failing test mysql_client_test · 6d4b0958
      Monty authored
      Backported patch from 10.3 that allows one to remove short .frm files
      6d4b0958
    • Monty's avatar
      Ensure that mysqladmin also works with MariaDB 10.3 + more · 3eaca005
      Monty authored
      Increase the number of status variabels that can be handled
      3eaca005
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · bce40651
      Marko Mäkelä authored
      bce40651
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 51c73a43
      Marko Mäkelä authored
      51c73a43
    • Marko Mäkelä's avatar
      Post-fix for MDEV-14587 · 447931c6
      Marko Mäkelä authored
      dict_stats_process_entry_from_defrag_pool(): Release the mutex
      447931c6
  3. 06 Dec, 2017 10 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · ce076765
      Marko Mäkelä authored
      ce076765
    • Marko Mäkelä's avatar
      Follow-up fix to MDEV-13201 Assertion `srv_undo_sources || ...` failed on... · 77fb7ccb
      Marko Mäkelä authored
      Follow-up fix to MDEV-13201 Assertion `srv_undo_sources || ...` failed on shutdown during DDL operation
      
      Introduce the debug flag trx_t::persistent_stats to suppress the
      assertion for the updates of persistent statistics during fast
      shutdown.
      
      dict_stats_exec_sql(): Do execute the statement even though shutdown
      has been initiated.
      77fb7ccb
    • Marko Mäkelä's avatar
      MDEV-14511 Use fewer transactions for updating InnoDB persistent statistics · 7dc6066d
      Marko Mäkelä authored
      dict_stats_exec_sql(): Expect the caller to always provide a transaction.
      Remove some redundant assertions. The caller must hold dict_sys->mutex,
      but holding dict_operation_lock is only necessary for accessing
      data dictionary tables, which we are not accessing.
      
      dict_stats_save_index_stat(): Acquire dict_sys->mutex
      for invoking dict_stats_exec_sql().
      
      dict_stats_save(), dict_stats_update_for_index(), dict_stats_update(),
      dict_stats_drop_index(), dict_stats_delete_from_table_stats(),
      dict_stats_delete_from_index_stats(), dict_stats_drop_table(),
      dict_stats_rename_in_table_stats(), dict_stats_rename_in_index_stats(),
      dict_stats_rename_table(): Use a single caller-provided
      transaction that is started and committed or rolled back by the caller.
      
      dict_stats_process_entry_from_recalc_pool(): Let the caller provide
      a transaction object.
      
      ha_innobase::open(): Pass a transaction to dict_stats_init().
      
      ha_innobase::create(), ha_innobase::discard_or_import_tablespace():
      Pass a transaction to dict_stats_update().
      
      ha_innobase::rename_table(): Pass a transaction to
      dict_stats_rename_table(). We do not use the same transaction
      as the one that updated the data dictionary tables, because
      we already released the dict_operation_lock. (FIXME: there is
      a race condition; a lock wait on SYS_* tables could occur
      in another DDL transaction until the data dictionary transaction
      is committed.)
      
      ha_innobase::info_low(): Pass a transaction to dict_stats_update()
      when calculating persistent statistics.
      
      alter_stats_norebuild(), alter_stats_rebuild(): Update the
      persistent statistics as well. In this way, a single transaction
      will be used for updating the statistics of a whole table, even
      for partitioned tables.
      
      ha_innobase::commit_inplace_alter_table(): Drop statistics for
      all partitions when adding or dropping virtual columns, so that
      the statistics will be recalculated on the next handler::open().
      This is a refactored version of Oracle Bug#22469660 fix.
      
      RecLock::add_to_waitq(), lock_table_enqueue_waiting():
      Do not allow a lock wait to occur for updating statistics
      in a data dictionary transaction, such as DROP TABLE. Instead,
      return the previously unused error code DB_QUE_THR_SUSPENDED.
      
      row_merge_lock_table(), row_mysql_lock_table(): Remove dead code
      for handling DB_QUE_THR_SUSPENDED.
      
      row_drop_table_for_mysql(), row_truncate_table_for_mysql():
      Drop the statistics as part of the data dictionary transaction.
      After TRUNCATE TABLE, the statistics will be recalculated on
      subsequent ha_innobase::open(), similar to how the logic after
      the above-mentioned Oracle Bug#22469660 fix in
      ha_innobase::commit_inplace_alter_table() works.
      
      btr_defragment_thread(): Use a single transaction object for
      updating defragmentation statistics.
      
      dict_stats_save_defrag_stats(), dict_stats_save_defrag_stats(),
      dict_stats_process_entry_from_defrag_pool(),
      dict_defrag_process_entries_from_defrag_pool(),
      dict_stats_save_defrag_summary(), dict_stats_save_defrag_stats():
      Add a parameter for the transaction.
      
      dict_stats_empty_table(): Make public. This will be called by
      row_truncate_table_for_mysql() after dropping persistent statistics,
      to clear the memory-based statistics as well.
      7dc6066d
    • Sergei Petrunia's avatar
      MDEV-14563: Wrong query plan for query with no PK · 2c1e4d4d
      Sergei Petrunia authored
      Part #2: Don't use the new code for the clustered PK, it is handled
      in the special way right above.
      2c1e4d4d
    • Sergei Petrunia's avatar
      MDEV-14563: Wrong query plan for query with no PK · a6254e5e
      Sergei Petrunia authored
      TABLE_SHARE::init_from_binary_frm_image() calls handler_file->index_flags()
      before it has set TABLE_SHARE::primary_key (it is 0 while it should be
      MAX_KEY in my example).
      This causes MyRocks to report wrong index flags (it thinks it's a PK while
      it is not), which causes invalid query plans later on.
      
      Do the only thing that seems feasible: adjust field->part_of key to have
      correct value in ha_rocksdb::open.
      a6254e5e
    • Sergei Petrunia's avatar
      MDEV-14433: RocksDB may show empty or incorrect output with rocksdb_strict_collation_check=off · c3803914
      Sergei Petrunia authored
      Part#1: Set field->part_of_key correctly for PK fields.
      c3803914
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      b1cd5ca2
    • Marko Mäkelä's avatar
      e9bc0f75
  4. 05 Dec, 2017 3 commits
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 1d526f31
      Marko Mäkelä authored
      1d526f31
    • Marko Mäkelä's avatar
      MDEV-14587 dict_stats_process_entry_from_defrag_pool() fails to call... · 63cbb982
      Marko Mäkelä authored
      MDEV-14587 dict_stats_process_entry_from_defrag_pool() fails to call dict_table_close() when index==NULL
      
      dict_stats_process_entry_from_defrag_pool(): Simplify the logic,
      and always call dict_table_close() when dict_table_open() returned
      a non-NULL handle.
      63cbb982
    • Marko Mäkelä's avatar
      MDEV-13670/MDEV-14550 Error log flood : "InnoDB: page_cleaner: 1000ms... · d1ab8903
      Marko Mäkelä authored
      MDEV-13670/MDEV-14550 Error log flood :  "InnoDB: page_cleaner: 1000ms intended loop took N ms. The settings might not be optimal."
      
      Silence the error log output that was introduced in MySQL 5.7
      (MariaDB 10.2.2) if log_warnings=2 or less.
      
      We should still figure out what these messages really indicate
      and how to solve the problems.
      
      pc_sleep_if_needed(): Add a parameter for the current time,
      so that there will be fewer successive calls to ut_time_ms()
      with no I/O between them.
      
      buf_flush_page_cleaner_coordinator(): Exit the first loop
      whenever shutdown has been requested. At the start of the loop,
      call ut_time_ms() only once. Do not display the message if
      log_warnings=2 or less.
      d1ab8903
  5. 04 Dec, 2017 2 commits
  6. 03 Dec, 2017 1 commit
    • Monty's avatar
      MDEV-10688 rpl.rpl_row_log_innodb failed in buildbot · d7b0b8dd
      Monty authored
      Problem was that Binlog_checkpoint can happen at random times.
      Fixed by not write binlog_checkpoint for the rpl_log test.
      
      Other things:
      - Removed not used variable "$keep_gtid_events"
      - Added option for show_binlog_events to skip binlog_checkpoint
      d7b0b8dd