1. 15 Nov, 2019 11 commits
    • Marko Mäkelä's avatar
      MDEV-16264: Fix some white space · 80409986
      Marko Mäkelä authored
      80409986
    • Marko Mäkelä's avatar
      MDEV-21054 Crash on shutdown due to btr_search_latches=NULL · 37f1ab23
      Marko Mäkelä authored
      innodb_shutdown(): Invoke os_aio_free() before btr_search_sys_free().
      37f1ab23
    • Vladislav Vaintroub's avatar
      Make .clang-format work with clang-8 · a808c18b
      Vladislav Vaintroub authored
      Remove keywords that are too new.
      a808c18b
    • Vladislav Vaintroub's avatar
      4e30a57e
    • Vladislav Vaintroub's avatar
      MDEV-16264 Use threadpool for Innodb background work. · 5e62b6a5
      Vladislav Vaintroub authored
      Almost all threads have gone
      - the "ticking" threads, that sleep a while then do some work)
      (srv_monitor_thread, srv_error_monitor_thread, srv_master_thread)
      were replaced with timers. Some timers are periodic,
      e.g the "master" timer.
      
      - The btr_defragment_thread is also replaced by a timer , which
      reschedules it self when current defragment "item" needs throttling
      
      - the buf_resize_thread and buf_dump_threads are substitutes with tasks
      Ditto with page cleaner workers.
      
      - purge workers threads are not tasks as well, and purge cleaner
      coordinator is a combination of a task and timer.
      
      - All AIO is outsourced to tpool, Innodb just calls thread_pool::submit_io()
      and provides the callback.
      
      - The srv_slot_t was removed, and innodb_debug_sync used in purge
      is currently not working, and needs reimplementation.
      5e62b6a5
    • Vladislav Vaintroub's avatar
      MDEV-16264: Add threadpool library · 00ee8d85
      Vladislav Vaintroub authored
      The library is capable of
      - asynchronous execution of tasks (and optionally waiting for them)
      - asynchronous file IO
        This is implemented using libaio on Linux and completion ports on
        Windows. Elsewhere, async io is "simulated", which means worker threads
        are performing synchronous IO.
      - timers, scheduling work asynchronously in some point of the future.
        Also periodic timers are implemented.
      00ee8d85
    • Vladislav Vaintroub's avatar
      MDEV-16264 prerequisite patch, ha_preshutdown. · 7e08dd85
      Vladislav Vaintroub authored
      This is a prerequisite patch required to remove Innodb's
      thd_destructor_proxy thread.
      
      The patch implement pre-shutdown functionality for handlers.
      
      A storage engine might need to perform some work after all user
      connections are shut down, but before killing off the plugins.
      
      The reason is that an SE could still be using some of the
      server infrastructure. In case of Innodb this would be purge threads,
      that call into the server to calculate results of virtual function,
      acquire MDL locks on tables, or possibly also use the audit plugins.
      7e08dd85
    • Vladislav Vaintroub's avatar
      MDEV-16264 - prerequisite patch - true background THDs · e7549917
      Vladislav Vaintroub authored
      Create background THDs that are not counted, and do not block
      close_connections(), in other words they are just something that plugin
      can use internally.
      
      These THD will be used later by Innodb purge threads, and they need THD
      to calculate virtual functions.
      e7549917
    • Vladislav Vaintroub's avatar
      MDEV-16264 prerequisite patch, enable thr_timer in embedded · 2fb23b89
      Vladislav Vaintroub authored
      Since threadpool is using thr_timer, and it also exist in embedded version,
      initialize timer also in embedded version
      2fb23b89
    • Vladislav Vaintroub's avatar
      MDEV-16264 - prerequisite patch, periodic thr_timer · ad17c98d
      Vladislav Vaintroub authored
      Threadpool will need a functionality for periodic thr_timer
      (the threadpool maintainence task is a timer that runs periodically).
      
      Also increase the stack size for the timer thread, 8k won't be enough.
      ad17c98d
    • Marko Mäkelä's avatar
      Cleanup: More use of mtr_memo_type_t · 786b0049
      Marko Mäkelä authored
      786b0049
  2. 14 Nov, 2019 9 commits
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · ae90f843
      Marko Mäkelä authored
      ae90f843
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 89ae01fd
      Marko Mäkelä authored
      89ae01fd
    • Marko Mäkelä's avatar
      MDEV-20949: Merge 10.3 into 10.4 · 746ee785
      Marko Mäkelä authored
      746ee785
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 3bee95d7
      Marko Mäkelä authored
      3bee95d7
    • Jean Weisbuch's avatar
      MDEV-4476: mytop tracker · c454b896
      Jean Weisbuch authored
      - Added dynamic column width fro `user` and `db` columns
      - Added option `%` to hide the progress
      - Follow up changes from Ubuntu
      - Take `INFORMATION_SCHEMA.PROCESSLIST` into account to determine
        progress of the `actual stage`
      - Indentation fixes
      
      Closes #215
      c454b896
    • Marko Mäkelä's avatar
      MDEV-12353 preparation: Replace mtr_x_lock() and friends · 3d4a8015
      Marko Mäkelä authored
      Apart from page latches (buf_block_t::lock), mini-transactions
      are keeping track of at most one dict_index_t::lock and
      fil_space_t::latch at a time, and in a rare case, purge_sys.latch.
      
      Let us introduce interfaces for acquiring an index latch
      or a tablespace latch.
      
      In a later version, we may want to introduce mtr_t members
      for holding a latched dict_index_t* and fil_space_t*,
      and replace the remaining use of mtr_t::m_memo
      with std::set<buf_block_t*> or with a map<buf_block_t*,byte*>
      pointing to log records.
      3d4a8015
    • Marko Mäkelä's avatar
      MDEV-20949: Merge 10.2 into 10.3 · 4ded5fb9
      Marko Mäkelä authored
      In the test innodb.instant_alter,4k we would be flagging an error
      for too large row size. That error was previously only being reported
      if the table was being rebuilt. Thus, this merge is fixing a small
      omission in MDEV-11369 (instant ADD COLUMN).
      4ded5fb9
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · bc5cfe77
      Marko Mäkelä authored
      bc5cfe77
    • Sujatha's avatar
      MDEV-20707: Missing memory barrier in parallel replication error handler in wait_for_prior_commit() · caa79081
      Sujatha authored
      revision-id: 673e253724979fd9fe43a4a22bd7e1b2c3a5269e
      Author: Kristian Nielsen
      
      Fix missing memory barrier in wait_for_commit.
      
      The function wait_for_commit::wait_for_prior_commit() has a fast path where it
      checks without locks if wakeup_subsequent_commits() has already been called.
      This check was missing a memory barrier. The waitee thread does two writes to
      variables `waitee' and `wakeup_error', and if the waiting thread sees the
      first write it _must_ also see the second or incorrect behavior will occur.
      This requires memory barriers between both the writes (release semantics) and
      the reads (acquire semantics) of those two variables.
      
      Other accesses to these variables are done under lock or where only one thread
      will be accessing them, and can be done without barriers (relaxed semantics).
      caa79081
  3. 13 Nov, 2019 8 commits
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · c99470b3
      Marko Mäkelä authored
      c99470b3
    • Marko Mäkelä's avatar
      MDEV-17138 follow-up: Optimize index page creation · 49019dde
      Marko Mäkelä authored
      btr_create(), btr_root_raise_and_insert(): Write a MLOG_MEMSET record
      to set FIL_PAGE_PREV,FIL_PAGE_NEXT to FIL_NULL, instead of writing
      two MLOG_4BYTES records.
      
      For ROW_FORMAT=COMPRESSED pages, we will not use MLOG_MEMSET
      because we want the crash-downgrade to earlier 10.4 releases to succeed.
      
      mlog_parse_nbytes(): Relax the too strict assertion. There is no problem
      with MLOG_MEMSET records that affect the uncompressed header of
      ROW_FORMAT=COMPRESSED index pages.
      49019dde
    • Sergei Petrunia's avatar
      MDEV-20646: 10.3.18 is slower than 10.3.17 · d4edb051
      Sergei Petrunia authored
      Fix incorrect change introduced in the fix for MDEV-20109.
      
      The patch tried to compute a more precise estimate for the record_count
      value in SJ-Materialization-Scan strategy (in
      Sj_materialization_picker::check_qep).  However the new formula is worse
      as it produces extremely optimistic results in common cases where
      SJ-Materialization-Scan should be used)
      
      The old formula produces pessimistic results in cases when Sj-Materialization-
      Scan is unlikely to be a good choice anyway. So, the old behavior is better.
      d4edb051
    • Eugene Kosov's avatar
      MDEV-20949 Stop issuing 'row size' error on DML · 98694ab0
      Eugene Kosov authored
      Move row size check to early CREATE/ALTER TABLE phase. Stop checking
      on table open.
      
      dict_index_add_to_cache(): remove parameter 'strict', stop checking row size
      
      dict_index_t::record_size_info_t: this is a result of row size check operation
      
      create_table_info_t::row_size_is_acceptable(): performs row size check.
      Issues error or warning. Writes first overflow field to InnoDB log.
      
      create_table_info_t::create_table(): add row size check
      
      dict_index_t::record_size_info(): this is a refactored version
      of dict_index_t::rec_potentially_too_big(). New version doesn't change global
      state of a program but return all interesting info. And it's callers who
      decide how to handle row size overflow.
      
      dict_index_t::rec_potentially_too_big(): removed
      98694ab0
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      Use constexpr for constants on data pages · 2b7aa60b
      Marko Mäkelä authored
      2b7aa60b
    • Marko Mäkelä's avatar
      Clean up mtr_t::commit() further · 3b573c07
      Marko Mäkelä authored
      memo_block_unfix(), memo_latch_release(): Merge to ReleaseLatches.
      
      memo_slot_release(), ReleaseAll: Clean up the formatting.
      3b573c07
    • Marko Mäkelä's avatar
      MDEV-20934: Correct a debug assertion · abd45cdc
      Marko Mäkelä authored
      A search with PAGE_CUR_GE may land on the supremum record on
      a leaf page that is not the rightmost leaf page.
      This could occur when all keys on the current page are
      smaller than the search key, and the smallest key on the
      successor page is larger than the search key.
      
      ibuf_delete_recs(): Correct the debug assertion accordingly.
      abd45cdc
  4. 12 Nov, 2019 12 commits