1. 09 May, 2019 1 commit
  2. 07 May, 2019 1 commit
  3. 06 May, 2019 5 commits
  4. 05 May, 2019 4 commits
  5. 04 May, 2019 1 commit
    • Sergey Vojtovich's avatar
      Restore vars_list destructor · e8dd18a4
      Sergey Vojtovich authored
      Regression after reverting fair THD members constructors/destructors.
      vars_list can be used standalone, in such cases destructor is needed.
      
      Part of MDEV-14984 - regression in connect performance
      e8dd18a4
  6. 03 May, 2019 20 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · b6f4cccd
      Marko Mäkelä authored
      b6f4cccd
    • Marko Mäkelä's avatar
      MDEV-19385: Inconsistent definition of dtuple_get_nth_v_field() · ce195987
      Marko Mäkelä authored
      The accessor dtuple_get_nth_v_field() was defined differently between
      debug and release builds in MySQL 5.7.8 in
      mysql/mysql-server@c47e1751b742454de553937039bbf2bcbe3c6bc7
      and a debug assertion to document or enforce the questionable assumption
      tuple->v_fields == &tuple->fields[tuple->n_fields] was missing.
      
      This was apparently no problem until MDEV-11369 introduced instant
      ADD COLUMN to MariaDB Server 10.3. With that work present, in one
      test case, trx_undo_report_insert_virtual() could in release builds
      fetch the wrong value for a virtual column.
      
      We replace many of the dtuple_t accessors with const-preserving
      inline functions, and fix missing or misleadingly applied const
      qualifiers accordingly.
      ce195987
    • Marko Mäkelä's avatar
      MDEV-19346: Remove dummy InnoDB log checkpoints · 3db94d24
      Marko Mäkelä authored
      log_checkpoint(), log_make_checkpoint_at(): Remove the parameter
      write_always. It seems that the primary purpose of this parameter
      was to ensure in the function recv_reset_logs() that both checkpoint
      header pages will be overwritten, when the function is called from
      the never-enabled function recv_recovery_from_archive_start().
      
      create_log_files(): Merge recv_reset_logs() to its only caller.
      
      Debug instrumentation: Prefer to flush the redo log, instead of
      triggering a redo log checkpoint.
      
      page_header_set_field(): Disable a debug assertion that will
      always fail due to MDEV-19344, now that we no longer initiate
      a redo log checkpoint before an injected crash.
      
      In recv_reset_logs() there used to be two calls to
      log_make_checkpoint_at(). The apparent purpose of this was
      to ensure that both InnoDB redo log checkpoint header pages
      will be initialized or overwritten.
      The second call was removed (without any explanation) in MySQL 5.6.3:
      mysql/mysql-server@4ca37968da54ddc6b3b6628f41428ddba1c79bb8
      
      In MySQL 5.6.8 WL#6494, starting with
      mysql/mysql-server@00a0ba8ad92569fcf08212b3b8cf046dc8a0ce10
      the function recv_reset_logs() was not only invoked during
      InnoDB data file initialization, but also during a regular
      startup when the redo log is being resized.
      
      mysql/mysql-server@45e91679832219e2593c77185342f11f85232b58
      in MySQL 5.7.2 removed the UNIV_LOG_ARCHIVE code, but still
      did not remove the parameter write_always.
      3db94d24
    • Eugene Kosov's avatar
      MDEV-17702 fix unaligned access UB in sint4korr() and similar functions · bcc13592
      Eugene Kosov authored
      Disable (hopefully temprorary) this check. Also add tests for some serialized
      functions.
      bcc13592
    • Sergey Vojtovich's avatar
      Revert THD::THD(skip_global_sys_var_lock) argument · 779fb636
      Sergey Vojtovich authored
      Originally introduced by e972125f to avoid harmless wait for
      LOCK_global_system_variables in a newly created thread, which creation was
      initiated by system variable update.
      
      At the same time it opens dangerous hole, when system variable update
      thread already released LOCK_global_system_variables and ack_receiver
      thread haven't yet completed new THD construction. In this case THD
      constructor goes completely unprotected.
      
      Since ack_receiver.stop() waits for the thread to go down, we have to
      temporarily release LOCK_global_system_variables so that it doesn't
      deadlock with ack_receiver.run(). Unfortunately it breaks atomicity
      of rpl_semi_sync_master_enabled updates and makes them not serialized.
      
      LOCK_rpl_semi_sync_master_enabled was introduced to workaround the above.
      TODO: move ack_receiver start/stop into repl_semisync_master
      enable_master/disable_master under LOCK_binlog protection?
      
      Part of MDEV-14984 - regression in connect performance
      779fb636
    • Sergey Vojtovich's avatar
      Adieu find_sys_var_ex() · 894df7ed
      Sergey Vojtovich authored
      Only take LOCK_plugin for plugin system variables.
      
      Reverted optimisation that was originally done for session tracker: it
      makes much less sense now. Specifically only if connections would want to
      track plugin session variables changes and these changes would actually
      happen frequently. If this ever becomes an issue, there're much better
      ways to optimise this workload.
      
      Part of MDEV-14984 - regression in connect performance
      894df7ed
    • Sergey Vojtovich's avatar
      Make connect speed great again · 53671a1f
      Sergey Vojtovich authored
      Rather than parsing session_track_system_variables when thread starts, do
      it when first trackable event occurs.
      
      Benchmarked on a 2socket/20core/40threads Broadwell system using sysbench
      connect brencmark @40 threads (with select 1 disabled):
      101379.77 -> 143016.68 CPS, whereas 10.2 is currently at 137766.31 CPS.
      
      Part of MDEV-14984 - regression in connect performance
      53671a1f
    • Sergey Vojtovich's avatar
      Safe session_track_system_variables snapshot · 1b5cf2f7
      Sergey Vojtovich authored
      When enabling system variables tracker, make a copy of
      global_system_variables.session_track_system_variables
      under LOCK_global_system_variables. This protects from concurrent variable
      updates and potential freed memory access, as well as from variable
      reconstruction (which was previously protected by LOCK_plugin).
      
      We can also use this copy as a session variable pointer, so that we don't
      have to allocate memory and reconstruct it every time it is referenced.
      
      For this very reason we don't need buffer_length stuff anymore.
      
      As well as don't we need to take LOCK_plugin early in ::enable().
      Unified ::parse_var_list() to acquire LOCK_plugin unconditionally.
      For no apparent reason it wasn't previously acquired for global
      variable update.
      
      Part of MDEV-14984 - regression in connect performance
      1b5cf2f7
    • Sergey Vojtovich's avatar
      Allocate Session_sysvars_tracker statically · 554ac6f3
      Sergey Vojtovich authored
      One less new/delete per connection.
      
      Removed m_mem_flag since most allocs are thread specific. The only
      exception are allocs performed during initialization.
      
      Removed State_tracker and Session_tracker constructors as they don't make
      sense anymore.
      
      No reason to access session_sysvars_tracker via get_tracker(), so access
      it directly instead.
      
      Part of MDEV-14984 - regression in connect performance
      554ac6f3
    • Sergey Vojtovich's avatar
      Allocate Transaction_state_tracker statically · a7adc2ce
      Sergey Vojtovich authored
      One less new/delete per connection.
      
      Part of MDEV-14984 - regression in connect performance
      a7adc2ce
    • Sergey Vojtovich's avatar
      Static current schema and state change trackers · 47bd06d5
      Sergey Vojtovich authored
      Saves 2 new/delete per connection.
      
      Part of MDEV-14984 - regression in connect performance
      47bd06d5
    • Sergey Vojtovich's avatar
      Allocate orig_list statically · 01e8f3c5
      Sergey Vojtovich authored
      tool_list is a temporary list needed only for SET SESSION
      session_track_system_variables, so allocate it on stack instead.
      
      Sane reinit() calls.
      
      Saves 2 new/delete per connection.
      
      Part of MDEV-14984 - regression in connect performance
      01e8f3c5
    • Sergey Vojtovich's avatar
      Get rid of not implemented SESSION_GTIDS_TRACKER · 55bdd7f7
      Sergey Vojtovich authored
      One less new/delete per connection.
      
      Part of MDEV-14984 - regression in connect performance
      55bdd7f7
    • Sergey Vojtovich's avatar
      Cleanup session tracker API · 2be28a91
      Sergey Vojtovich authored
      - Session_sysvars_tracker::server_init_check() -> sysvartrack_validate_value()
      - Session_sysvars_tracker::check_var_list()    -> sysvartrack_validate_value()
      
      - Session_sysvars_tracker::server_init_process() -> sysvartrack_global_update()
      - sysvartrack_reprint_value()                    -> sysvartrack_global_update()
      
      - sysvartrack_value_len()       -> sysvartrack_session_value_ptr()
      - sysvartrack_value_construct() -> sysvartrack_session_value_ptr()
      
      - sysvartrack_update() -> Session_sysvars_tracker::update()
      - Session_tracker::server_boot_verify() -> session_tracker_init()
      - sysvar_tracker() -> /dev/null
      
      Part of MDEV-14984 - regression in connect performance
      2be28a91
    • Sergey Vojtovich's avatar
      Cleanup session tracker redundancy · 19d5ddcc
      Sergey Vojtovich authored
      - m_enabled is initialised by the base class constructor
      - removed unused schema_track_inited
      - moved Transaction_state_tracker constructor to declaration
      - common enable()
      - removed unused Session_sysvars_tracker::check_str()
      - classes are "private" by default
      - don't even try to compile for embedded
      
      Part of MDEV-14984 - regression in connect performance
      19d5ddcc
    • Sergey Vojtovich's avatar
      Session_sysvars_tracker::vars_list cleanups · 8f594b33
      Sergey Vojtovich authored
      - return proper type
      - removed useless node argument
      - removed useless mem_flag
      - classes are "private" by default
      - simplified iterators
      
      Part of MDEV-14984 - regression in connect performance
      8f594b33
    • Sergey Vojtovich's avatar
      A proper State_tracker::m_changed enacpsulation · 0e91e0c3
      Sergey Vojtovich authored
      Note: preserved original behaviour, where remaining trackers are not reset
      on error from store(). This effectively means subsequent statements will
      start tracking from unclean state.
      
      Part of MDEV-14984 - regression in connect performance
      0e91e0c3
    • seppo's avatar
      MDEV-18552 MDEV-18699 allowing SR only in galera 4 cluster (#1293) · d18ef804
      seppo authored
      Streaming replication must be allowed only in a cluster, where all nodes
      have  Galera 4 capability
      d18ef804
    • Varun Gupta's avatar
      MDEV-18117: Crash with Explain extended when using limit rows examined · ca098107
      Varun Gupta authored
      No need to set SELECT_LEX:explicit_limit when we have a limit clause
      that sets only the EXAMINED ROWS
      ca098107
    • Varun Gupta's avatar
      MDEV-18943: Group Concat with limit not working with views · 879878e4
      Varun Gupta authored
      Adjusted the Item_func_group_concat::print function to take into account
      limit if present with GROUP_CONCAT
      879878e4
  7. 02 May, 2019 8 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 51823483
      Marko Mäkelä authored
      51823483
    • Vladislav Vaintroub's avatar
      MDEV-17008 prepare with datadir, on Windows, does not set ACL · 13d7c721
      Vladislav Vaintroub authored
      on tablespace files
      
      Fix is to always add Full Control for NetworkService account, for every
      file that copyback/moveback copies around.
      13d7c721
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 158247d3
      Marko Mäkelä authored
      158247d3
    • Monty's avatar
      Fixed deadlock in main.flush_read_lock · 18663539
      Monty authored
      local_global_read_lock did release all HANDLER's before taking its
      MDL_BACKUP_FTWRL# locks. This had a potential race condition if
      there was a waiting LOCK TABLE for one of the freed handlers.
      
      Fixed by moving the release of HANDLER's to after the backup locks are
      taken.
      
      After commit 8cf7e345 it's not anymore critical to free HANDLER's in
      FTWRL, but we will keep the mysql_ha_cleanup_no_free() call until 10.5
      to not cause any issues with 10.4 just before it's going GA.
      18663539
    • Monty's avatar
      Fixed some compilation warnings/errors · 0d6fb43e
      Monty authored
      0d6fb43e
    • Vladislav Vaintroub's avatar
      MDEV-18544 "missing required privilege PROCESS on *.*" using mariabackup for SST · 4b0f010b
      Vladislav Vaintroub authored
      If required privilege is missing, dump the output from "SHOW GRANTS"
      into mariabackup log.
      
      This will help troubleshooting, and make the bug reproducible.
      4b0f010b
    • Monty's avatar
      Enable mysqlcheck and flush_read_lock tests · 0cc7c608
      Monty authored
      - Updated results
      - Run mysqlcheck without --user-stat-tables=PREFERABLY to keep results
        consistent
      - Don't allow one to run analyze table under FTWRL as analyze table
        nowadays has to update status tables.
      0cc7c608
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-14398 innodb_encryption_rotate_key_age=0 causes innodb_encrypt_tables to be ignored · ada1074b
      Thirunarayanan Balathandayuthapani authored
      The statement
      
      SET GLOBAL innodb_encryption_rotate_key_age=0;
      
      would have the unwanted side effect that ENCRYPTION=DEFAULT tablespaces
      would no longer be encrypted or decrypted according to the setting of
      innodb_encrypt_tables.
      
      We implement a trigger, so that whenever one of the following is executed:
      
      SET GLOBAL innodb_encrypt_tables=OFF;
      SET GLOBAL innodb_encrypt_tables=ON;
      SET GLOBAL innodb_encrypt_tables=FORCE;
      
      all wrong-state ENCRYPTION=DEFAULT tablespaces will be added to
      fil_system_t::rotation_list, so that the encryption will be added
      or removed.
      
      Note: This will *NOT* happen automatically after a server restart.
      Before reading the first page of a data file, InnoDB cannot know
      the encryption status of the data file. The statement
      SET GLOBAL innodb_encrypt_tables will have the side effect that
      all not-yet-read InnoDB data files will be accessed in order to
      determine the encryption status.
      
      innodb_encrypt_tables_validate(): Stop disallowing
      SET GLOBAL innodb_encrypt_tables when innodb_encryption_rotate_key_age=0.
      This reverts part of commit 50eb40a2
      that addressed MDEV-11738 and MDEV-11581.
      
      fil_system_t::read_page0(): Trigger a call to fil_node_t::read_page0().
      Refactored from fil_space_get_space().
      
      fil_crypt_rotation_list_fill(): If innodb_encryption_rotate_key_age=0,
      initialize fil_system->rotation_list. This is invoked both on
      SET GLOBAL innodb_encrypt_tables and
      on SET GLOBAL innodb_encryption_rotate_key_age=0.
      
      fil_space_set_crypt_data(): Remove.
      
      fil_parse_write_crypt_data(): Simplify the logic.
      
      This is joint work with Marko Mäkelä.
      ada1074b