1. 10 Mar, 2020 10 commits
    • Marko Mäkelä's avatar
      MDEV-21748 ASAN use-after-poison in PageBulk::insertPage() · 561b5ce3
      Marko Mäkelä authored
      PageBulk::insertPage(): Check the array bounds before comparing.
      We used to read one byte beyond the end of the 'rec' payload.
      The incorrect logic was originally introduced in
      commit 7ae21b18.
      561b5ce3
    • Marko Mäkelä's avatar
      MDEV-15528: Minor cleanup · e2e2f893
      Marko Mäkelä authored
      buf_flush_freed_page(): Reformat in the common style, and
      simplify some code. Prefer to request all information from
      smaller data structures (buf_page_t) than from fil_space_t
      or the global variable srv_immediate_scrub_data_uncompressed.
      
      SysTablespace::open_or_create(): Assert that the temporary
      tablespace will not be created in page_compressed format, so that
      buf_flush_freed_page() can avoid checking that on every call.
      
      IORequest: Remove duplicated constructors, and do not explicitly
      declare a default constructor.
      e2e2f893
    • Otto Kekäläinen's avatar
      Deb: Update Debian packaging to include mytop and all new man pages · e0e5d8c5
      Otto Kekäläinen authored
      Related to MDEV-21769.
      e0e5d8c5
    • Otto Kekäläinen's avatar
      Add a man page for mytop that is in sources · 86070765
      Otto Kekäläinen authored
      Related to MDEV-21769.
      86070765
    • Otto Kekäläinen's avatar
      Use correct reference in man page links · c7c0959c
      Otto Kekäläinen authored
      After the '.so' one is supposed to use the directory name, like we have
      correctly in all old man pages:
        mysql_client_test_embedded.1:.so man1/mysql_client_test.1
        mysql_embedded.1:.so man1/mysql.1
        mysqltest_embedded.1:.so man1/mysqltest.1
      
      This change adds the 'man1/' component so the link has the correct format.
      Actually using man links is a deprecated practice and using symlinks
      would be better, but that can be fixed in a later commit.
      
      From https://www.debian.org/doc/debian-policy/ch-docs.html#manual-pages:
      > If one man page needs to be accessible via several names it is better
      > to use a symbolic link than the .so feature
      
      Detected via Lintian errors:
        E: mariadb-server-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-show.1.gz
        E: mariadb-client-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-binlog.1.gz
        E: mariadb-client-10.5: bad-so-link-within-manual-page usr/share/man/man1/mariadb-plugin.1.gz
      
      Related to MDEV-21769.
      c7c0959c
    • Otto Kekäläinen's avatar
      Fix syntax error mysql-test-run in man page · 32fdf81f
      Otto Kekäläinen authored
      This fixes errors like:
      
        $ LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
          man --warnings -E UTF-8 -l -Tutf8 -Z mysql-test-run.pl.1 > /dev/null
      
        troff: <standard input>:246: warning [p 2, 6.0i, div '3tbd1,1', 0.3i]: can't break line
        troff: <standard input>:275: warning [p 2, 6.0i, div '3tbd6,1', 0.8i]: can't break line
      
      Related to MDEV-21769.
      32fdf81f
    • Otto Kekäläinen's avatar
      Add missing man pages for myrocks_hotbackup · 0335af74
      Otto Kekäläinen authored
      Related to MDEV-21769.
      0335af74
    • Oleksandr Byelkin's avatar
      MDEV-20632: Recursive CTE cycle detection using CYCLE clause (nonstandard) · 50c09391
      Oleksandr Byelkin authored
      Added CYCLE ... RESTRICT (nonstandard) clause to recursive CTE.
      50c09391
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-15528 Punch holes when pages are freed · a5584b13
      Thirunarayanan Balathandayuthapani authored
      The following parameters are deprecated:
      
        innodb-background-scrub-data-uncompressed
        innodb-background-scrub-data-compressed
        innodb-background-scrub-data-interval
        innodb-background-scrub-data-check-interval
      
      Removed scrubbing code completely(btr0scrub.h, btr0scrub.cc)
      Removed information_schema.innodb_tablespaces_scrubbing tables
      Removed the scrubbing logic from fil_crypt_thread()
      a5584b13
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-15528 Punch holes when pages are freed · a35b4ae8
      Thirunarayanan Balathandayuthapani authored
      When a InnoDB data file page is freed, its contents becomes garbage,
      and any storage allocated in the data file is wasted. During flushing,
      InnoDB initializes the page with zeros if scrubbing is enabled. If the
      tablespace is compressed then InnoDB should punch a hole else ignore the
      flushing of the freed page.
      
      buf_page_t:
      - Replaced the variable file_page_was_freed, init_on_flush in buf_page_t
      with status enum variable.
      - Changed all debug assert of file_page_was_freed to DBUG_ASSERT
      of buf_page_t::status
      
      Removed buf_page_set_file_page_was_freed(),
      buf_page_reset_file_page_was_freed().
      
      buf_page_free(): Newly added function which takes X-lock on the page
      before marking the status as FREED. So that InnoDB flush handler can
      avoid concurrent flush of the freed page. Also while flushing the page,
      InnoDB make sure that redo log which does freeing of the page also written
      to the disk. Currently, this function only marks the page as FREED if
      it is in buffer pool
      
      buf_flush_freed_page(): Newly added function which initializes zeros
      asynchorously if innodb_immediate_scrub_data_uncompressed is enabled.
      Punch a hole to the file synchorously if page_compressed is enabled.
      Reset the io_fix to NORMAL. Release the block from flush list and
      associated mutex before writing zeros or punch a hole to the file.
      
      buf_flush_page(): Removed the unnecessary usage of temporary
      variable "flush"
      
      fil_io(): Introduce new parameter called punch_hole. It allows fil_io()
      to punch the hole to the file for the given offset.
      
      buf_page_create(): Let the callers assign buf_page_t::status.
      Every caller should eventually invoke mtr_t::init().
      
      fsp_page_create(): Remove the unused mtr_t parameter.
      
      In all other callers of buf_page_create() except fsp_page_create(),
      before invoking mtr_t::init(), invoke
      mtr_t::sx_latch_at_savepoint() or mtr_t::x_latch_at_savepoint().
      
      mtr_t::init(): Initialize buf_page_t::status also for the temporary
      tablespace (when redo logging is disabled), to avoid assertion failures.
      a35b4ae8
  2. 09 Mar, 2020 7 commits
  3. 07 Mar, 2020 3 commits
    • Marko Mäkelä's avatar
      Cleanup: Remove recv_sys.remove_extra_log_files · 57c592f7
      Marko Mäkelä authored
      create_log_file(): Delete all old redo log files where they used to be
      deleted, after the crash injection point innodb_log_abort_6,
      before commit 9ef2d29f
      deprecated and ignored the setting innodb_log_files_in_group.
      57c592f7
    • Marko Mäkelä's avatar
      Cleanup: log upgrade and encryption · 70f0dbe4
      Marko Mäkelä authored
      log_crypt_101_read_checkpoint(), log_crypt_101_read_block():
      Declare as ATTRIBUTE_COLD. These are only used when
      checking that a MariaDB 10.1 encrypted redo log is clean.
      
      log_block_calc_checksum_format_0(): Define in the only
      compilation unit where it is needed. This is only used
      when reading the checkpoint information from redo logs
      before MariaDB 10.2.2.
      
      crypt_info_t: Declare the byte arrays directly with alignas().
      
      log_crypt(): Use memcpy_aligned instead of reinterpret_cast
      on integers.
      70f0dbe4
    • Marko Mäkelä's avatar
      Cleanup: Remove recv_sys.buf_size · 522fbfcb
      Marko Mäkelä authored
      Also, correctly document what recv_sys.mutex is protecting.
      522fbfcb
  4. 06 Mar, 2020 4 commits
  5. 05 Mar, 2020 7 commits
  6. 04 Mar, 2020 5 commits
    • Marko Mäkelä's avatar
      MDEV-21870 Deprecate and ignore innodb_scrub_log and innodb_scrub_log_speed · 64be4ab4
      Marko Mäkelä authored
      The configuration parameter innodb_scrub_log never really worked, as
      reported in MDEV-13019 and MDEV-18370.
      
      Because MDEV-14425 is changing the redo log format, the innodb_scrub_log
      feature would have to be adjusted for it. Due to the known problems,
      it is easier to remove the feature for now, and to ignore and deprecate
      the parameters.
      
      If old log contents should be kept secret, then enabling innodb_encrypt_log
      or setting a smaller innodb_log_file_size could help.
      64be4ab4
    • Ian Gilfillan's avatar
      MDEV-21228: mariadb-conv man page · d62766a8
      Ian Gilfillan authored
      d62766a8
    • Marko Mäkelä's avatar
      MDEV-18214 cleanup: Remove redundant MONITOR_INC calls · 8a25eb66
      Marko Mäkelä authored
      MONITOR_PENDING_CHECKPOINT_WRITE and MONITOR_LOG_IO track
      log_sys.n_pending_checkpoint_writes and log_sys.n_log_ios,
      respectively. The MONITOR_INC calls are redundant, because
      the values will be overwritten in srv_mon_process_existing_counter().
      8a25eb66
    • Marko Mäkelä's avatar
      Cleanup: Make MONITOR_LSN_CHECKPOINT_AGE a value. · 9e488653
      Marko Mäkelä authored
      Compute MONITOR_LSN_CHECKPOINT_AGE on demand in
      srv_mon_process_existing_counter().
      This allows us to remove the overhead of MONITOR_SET
      calls for the counter.
      9e488653
    • Marko Mäkelä's avatar
      MDEV-14425 preparation: Remove log_header_read() · 4383897a
      Marko Mäkelä authored
      The function log_header_read() was only used during server startup,
      and it will mostly be used only for reading checkpoint information
      from pre-MDEV-14425 format redo log files.
      
      Let us replace the function with more direct calls, so that
      it is clearer what is going on. It is not strictly necessary to
      hold any mutex during this operation, and because there will be
      only a limited number of operations during early server startup,
      it is not necessary to increment any I/O counters.
      4383897a
  7. 03 Mar, 2020 4 commits
    • Marko Mäkelä's avatar
      MDEV-14425 preparation: Remove log_t::append_on_checkpoint · 37e7bde1
      Marko Mäkelä authored
      Simplify the logging of ALTER TABLE operations, by making use of the
      TRX_UNDO_RENAME_TABLE undo log record that was introduced in
      commit 0bc36758.
      
      commit_try_rebuild(): Invoke row_rename_table_for_mysql() and
      actually rename the files before committing the transaction.
      
      fil_mtr_rename_log(), commit_cache_rebuild(),
      log_append_on_checkpoint(), row_merge_rename_tables_dict(): Remove.
      
      mtr_buf_copy_t, log_t::append_on_checkpoint: Remove.
      
      row_rename_table_for_mysql(): If !use_fk, ignore missing foreign
      keys. Remove a call to dict_table_rename_in_cache(), because
      trx_rollback_to_savepoint() should invoke the function if needed.
      37e7bde1
    • Marko Mäkelä's avatar
      MDEV-21534: Fix -Wmaybe-uninitialized · 1ef10744
      Marko Mäkelä authored
      group_commit_lock::release(): Ensure that prev will be initialized,
      simplify a comparison, and fix some white space.
      1ef10744
    • Marko Mäkelä's avatar
      MDEV-21724: Correctly invoke page_dir_split_slot() · a736a2cb
      Marko Mäkelä authored
      In commit 138cbec5, we
      computed an incorrect parameter to page_dir_split_slot(),
      leading us to splitting the wrong directory slot, or
      an out-of-bounds access when splitting the supremum slot.
      This was once caught in the test innodb_gis.kill_server for
      inserting records to a clustered index root page.
      
      page_dir_split_slot(): Take the slot as a pointer, instead of
      a numeric index.
      
      page_apply_insert_redundant(), page_apply_insert_dynamic():
      Rename slot to last_slot, and make owner_slot a pointer.
      a736a2cb
    • Marko Mäkelä's avatar
      MDEV-12353: Introduce an EXTENDED record subtype TRIM_PAGES · fae259f0
      Marko Mäkelä authored
      For undo log truncation, commit 055a3334
      repurposed the MLOG_FILE_CREATE2 record with a nonzero page size
      to indicate that an undo tablespace will be shrunk in size.
      In commit 7ae21b18 the
      MLOG_FILE_CREATE2 record was replaced by a FILE_CREATE record.
      
      Now that the redo log encoding was changed, there is no actual need
      to write a file name in the log record; it suffices to write the
      page identifier of the first page that is not part of the file.
      
      This TRIM_PAGES record could allow us to shrink any data files in the
      future. For now, it will be limited to undo tablespaces.
      
      mtr_t::log_file_op(): Remove the parameter first_page_no, because
      it would always be 0 for file operations.
      
      mtr_t::trim_pages(): Replaces fil_truncate_log().
      
      mtr_t::log_write(): Avoid same_page encoding if !bpage&&!m_last.
      
      fil_op_replay_rename(): Remove the constant parameter first_page_no=0.
      fae259f0