1. 23 Jun, 2021 10 commits
    • Marko Mäkelä's avatar
      MDEV-25113: Introduce a page cleaner mode before 'furious flush' · 6441bc61
      Marko Mäkelä authored
      MDEV-23855 changed the way how the page cleaner is signaled by
      user threads. If a threshold is exceeded, a mini-transaction commit
      would invoke buf_flush_ahead() in order to initiate page flushing
      before all writers would eventually grind to halt in
      log_free_check(), waiting for the checkpoint age to reduce.
      
      However, buf_flush_ahead() would always initiate 'furious flushing',
      making the buf_flush_page_cleaner thread write innodb_io_capacity_max
      pages per batch, and sleeping no time between batches, until the
      limit LSN is reached. Because this could saturate the I/O subsystem,
      system throughput could significantly reduce during these
      'furious flushing' spikes.
      
      With this change, we introduce a gentler version of flush-ahead,
      which would write innodb_io_capacity_max pages per second until
      the 'soft limit' is reached.
      
      buf_flush_ahead(): Add a parameter to specify whether furious flushing
      is requested.
      
      buf_flush_async_lsn: Similar to buf_flush_sync_lsn, a limit for
      the less intrusive flushing.
      
      buf_flush_page_cleaner(): Keep working until buf_flush_async_lsn
      has been reached.
      
      log_close(): Suppress a warning message in the event that a new log
      is being created during startup, when old logs did not exist.
      Return what type of page cleaning will be needed.
      
      mtr_t::finish_write(): Also when m_log.is_small(), invoke log_close().
      Return what type of page cleaning will be needed.
      
      mtr_t::commit(): Invoke buf_flush_ahead() based on the return value of
      mtr_t::finish_write().
      6441bc61
    • Marko Mäkelä's avatar
      MDEV-25113: Make page flushing faster · 22b62eda
      Marko Mäkelä authored
      buf_page_write_complete(): Reduce the buf_pool.mutex hold time,
      and do not acquire buf_pool.flush_list_mutex at all.
      Instead, mark blocks clean by setting oldest_modification to 1.
      Dirty pages of temporary tables will be identified by the special
      value 2 instead of the previous special value 1.
      (By design of the ib_logfile0 format, actual LSN values smaller
      than 2048 are not possible.)
      
      buf_LRU_free_page(), buf_pool_t::get_oldest_modification()
      and many other functions will remove the garbage (clean blocks)
      from buf_pool.flush_list while holding buf_pool.flush_list_mutex.
      
      buf_pool_t::n_flush_LRU, buf_pool_t::n_flush_list:
      Replaced with non-atomic variables, protected by buf_pool.mutex,
      to avoid unnecessary synchronization when modifying the counts.
      
      export_vars: Remove unnecessary indirection for
      innodb_pages_created, innodb_pages_read, innodb_pages_written.
      22b62eda
    • Marko Mäkelä's avatar
      MDEV-25801: buf_flush_dirty_pages() is very slow · 8af53897
      Marko Mäkelä authored
      In commit 7cffb5f6 (MDEV-23399)
      the implementation of buf_flush_dirty_pages() was replaced with
      a slow one, which would perform excessive scans of the
      buf_pool.flush_list and make little progress.
      
      buf_flush_list(), buf_flush_LRU(): Split from buf_flush_lists().
      Vladislav Vaintroub noticed that we will not need to invoke
      log_flush_task.wait() for the LRU eviction flushing.
      
      buf_flush_list_space(): Replaces buf_flush_dirty_pages().
      This is like buf_flush_list(), but operating on a single
      tablespace at a time. Writes at most innodb_io_capacity
      pages. Returns whether some of the tablespace might remain
      in the buffer pool.
      8af53897
    • Marko Mäkelä's avatar
      MDEV-25948 Remove log_flush_task · 762bcb81
      Marko Mäkelä authored
      Vladislav Vaintroub suggested that invoking log_flush_up_to()
      for every page could perform better than invoking a log write
      between buf_pool.flush_list batches, like we started doing in
      commit 3a9a3be1 (MDEV-23855).
      This could depend on the sequence in which pages are being
      modified. The buf_pool.flush_list is ordered by
      oldest_modification, while the FIL_PAGE_LSN of the pages is
      theoretically independent of that. In the pathological case,
      we will wait for a log write before writing each individual page.
      
      It turns out that we can defer the call to log_flush_up_to()
      until just before submitting the page write. If the doublewrite
      buffer is being used, we can submit a write batch of "future" pages
      to the doublewrite buffer, and only wait for the log write right
      before we are writing an already doublewritten page.
      The next doublewrite batch will not be initiated before the last
      page write from the current batch has completed.
      
      When a future version introduces asynchronous writes if the log,
      we could initiate a write at the start of a flushing batch, to
      reduce waiting further.
      762bcb81
    • Marko Mäkelä's avatar
      MDEV-25954: Trim os_aio_wait_until_no_pending_writes() · 6dfd44c8
      Marko Mäkelä authored
      It turns out that we had some unnecessary waits for no outstanding
      write requests to exist. They were basically working around a
      bug that was fixed in MDEV-25953.
      
      On write completion callback, blocks will be marked clean.
      So, it is sufficient to consult buf_pool.flush_list to determine
      which writes have not been completed yet.
      
      On FLUSH TABLES...FOR EXPORT we must still wait for all pending
      asynchronous writes to complete, because buf_flush_file_space()
      would merely guarantee that writes will have been initiated.
      6dfd44c8
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 344e5990
      Marko Mäkelä authored
      344e5990
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 09b03ff3
      Marko Mäkelä authored
      09b03ff3
    • Daniel Bartholomew's avatar
      bump the VERSION · 55b3a3f4
      Daniel Bartholomew authored
      55b3a3f4
    • Daniel Bartholomew's avatar
      bump the VERSION · bf2680ea
      Daniel Bartholomew authored
      bf2680ea
    • Daniel Bartholomew's avatar
      bump the VERSION · 1deb6304
      Daniel Bartholomew authored
      1deb6304
  2. 22 Jun, 2021 5 commits
  3. 21 Jun, 2021 13 commits
  4. 19 Jun, 2021 3 commits
  5. 18 Jun, 2021 3 commits
  6. 17 Jun, 2021 2 commits
  7. 16 Jun, 2021 3 commits
  8. 15 Jun, 2021 1 commit
    • Julius Goryavsky's avatar
      MDEV-25880 part 2: Improving reliability of the SST scripts · 2edb8e12
      Julius Goryavsky authored
      Additional improvements aimed at improving operational
      reliability of the SST scripts:
      
      1) Script need to give rsync and stunnel a short time to
         terminate after "kill -9" before the first PID check
         using ps utility;
      2) The temporary file used to create the binlog index could
         sometimes remain in the data directory if tar failed and
         then may be reused without being cleaned up (the next
         time when SST was run) - now it's fixed;
      3) The temporary file used to build the binlog index is now
         created using mktemp and, if this variable is present in
         the configuration file, in tmpdir;
      4) Checking the secret tag in SST via rsync is made faster
         and does not require creating a temporary file, which
         could remain in the data directory in case of failure;
      5) Added "-F" option to grep to check the tag when using
         mariabackup/xtrabackup-v2 - to avoid possible collisions
         in case of special characters in the tag value (unlikely
         scenario, but the new check is more reliable).
      2edb8e12