1. 05 Mar, 2020 3 commits
    • Marko Mäkelä's avatar
      MDEV-14425: Remove the unused function mtr_write_log() · 4b42fa3c
      Marko Mäkelä authored
      This amends commit 37e7bde1
      4b42fa3c
    • Marko Mäkelä's avatar
      MDEV-14425 preparation: Provide ut_crc32_low() · 1312b4eb
      Marko Mäkelä authored
      The ut_crc32() function uses a hard-coded initial CRC-32C value of 0.
      Replace it with ut_crc32_low(), which allows to specify the initial
      checksum value, and provide an inlined compatibility wrapper ut_crc32().
      
      Also, remove non-inlined wrapper functions on ARMv8 and POWER8,
      and remove dead code (the generic implementation) on POWER8.
      
      Note: The original AMD64 instruction set architecture in 2003 only
      included SSE2. The CRC-32C instructions are part of the SSE4.2
      instruction set extension for IA-32 and AMD64, with first processors
      released in November 2007 (using the AMD Barcelona microarchitecture)
      and November 2008 (Intel Nehalem microarchiteture). It might be safe
      to assume that SSE4.2 is available on all currently used AMD64 based
      systems, but we are not taking that step yet.
      1312b4eb
    • Marko Mäkelä's avatar
      6b317c1c
  2. 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
  3. 03 Mar, 2020 9 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
    • Rahul Anand's avatar
      73dfb402
    • Andy Fiddaman's avatar
      Merge pull request #1434 from citrus-it/illumos-auth-socket · 8f8cc5f4
      Andy Fiddaman authored
      MDEV-21476: auth_socket: add support for illumos with getpeerucred()
      8f8cc5f4
    • Aleksey Midenkov's avatar
    • Aleksey Midenkov's avatar
      MDEV-7318 RENAME INDEX · 193725b8
      Aleksey Midenkov authored
      This patch adds support of RENAME INDEX operation to the ALTER TABLE
      statement. Code which determines if ALTER TABLE can be done in-place
      for "simple" storage engines like MyISAM, Heap and etc. was updated to
      handle ALTER TABLE ... RENAME INDEX as an in-place operation. Support
      for in-place ALTER TABLE ... RENAME INDEX for InnoDB was covered by
      MDEV-13301.
      
      Syntax changes
      ==============
      
      A new type of <alter_specification> is added:
      
      <rename index clause> ::= RENAME ( INDEX | KEY ) <oldname> TO <newname>
      
      Where <oldname> and <newname> are identifiers for old name and new
      name of the index.
      
      Semantic changes
      ================
      
      The result of "ALTER TABLE t1 RENAME INDEX a TO b" is a table which
      contents and structure are identical to the old version of 't1' with
      the only exception index 'a' being called 'b'.
      
      Neither <oldname> nor <newname> can be "primary". The index being
      renamed should exist and its new name should not be occupied
      by another index on the same table.
      
      Related to: WL#6555, MDEV-13301
      193725b8
    • Aleksey Midenkov's avatar
      MDEV-16290 ALTER TABLE ... RENAME COLUMN syntax · fa8ad754
      Aleksey Midenkov authored
      The existing syntax for renaming a column uses "ALTER TABLE ...  CHANGE"
      command. This requires full column specification to rename the column.
      This patch adds new syntax "ALTER TABLE ...  RENAME COLUMN", which do not
      expect users to provide full column specification.  It means that the new
      syntax would pick in-place or copy algorithm in the same way as that of
      existing "ALTER TABLE ... CHANGE" command. The existing syntax
      "ALTER TABLE ... CHANGE" will continue to work.
      
      Syntax changes
      ==============
      
      ALTER TABLE tbl_name
          [alter_specification [, alter_specification] ...]
          [partition_options]
      
      Following is a new <alter_specification> added:
      
       | RENAME COLUMN <oldname> TO <newname>
      
      Where <oldname> and <newname> are identifiers for old name and new
      name of the column.
      
      Related to: WL#10761
      fa8ad754
  4. 02 Mar, 2020 4 commits
  5. 01 Mar, 2020 2 commits
  6. 28 Feb, 2020 3 commits
  7. 27 Feb, 2020 9 commits
    • Marko Mäkelä's avatar
      Fix GCC -Wsign-compare · 8db62303
      Marko Mäkelä authored
      8db62303
    • Marko Mäkelä's avatar
      Fix GCC -Wparentheses · a263ca26
      Marko Mäkelä authored
      a263ca26
    • Marko Mäkelä's avatar
      MDEV-21724: Optimize page_cur_insert_low() redo logging · 138cbec5
      Marko Mäkelä authored
      Inserting a record into an index page involves updating multiple
      fields in the page header as well as updating the next-record links
      and potentially updating fields related to the sparse page directory.
      
      Let us cover the insert operations by higher-level log records, to avoid
      'redundant' logging about the writes.
      
      The code for applying the high-level log records will check the
      consistency of the page thoroughly, to avoid crashes during recovery.
      We will refuse to replay the inserts if any inconsistency is detected.
      With innodb_force_recovery=1, recovery will continue, but the affected
      pages may be more inconsistent if some changes were omitted.
      
      mrec_ext_t: Introduce the EXTENDED record subtypes
      INSERT_HEAP_REDUNDANT, INSERT_REUSE_REDUNDANT,
      INSERT_HEAP_DYNAMIC, INSERT_REUSE_DYNAMIC.
      The record will explicitly identify the page type and whether
      the space will be allocated from PAGE_HEAP_TOP or reused from
      the PAGE_FREE list. It will also tell how many bytes to copy
      from the preceding record header and payload, and how to
      initialize the rest of the record header and payload.
      
      mtr_t::page_insert(): Write the high-level log records.
      
      log_phys_t::apply(): Parse the high-level log records.
      
      page_apply_insert_redundant(), page_apply_insert_dynamic():
      Apply the high-level log records.
      
      page_dir_split_slot(): Introduce a variant that does not write log
      nor deal with ROW_FORMAT=COMPRESSED pages.
      
      page_mem_alloc_heap(): Remove the mtr_t parameter
      
      page_cur_insert_rec_low(): Write log only via mtr_t::page_insert().
      138cbec5
    • Marko Mäkelä's avatar
      MDEV-12353 Cleanup: Remove page_rec_get_base_extra_size() · dee6fb35
      Marko Mäkelä authored
      The function page_rec_get_base_extra_size() became dead code in
      commit 08ba3887.
      dee6fb35
    • Marko Mäkelä's avatar
      MDEV-12353: Improve page_cur_delete_rec() recovery · e15ae1cf
      Marko Mäkelä authored
      This is a follow-up to commit 572d2075
      where we introduced the EXTENDED log record subtypes
      DELETE_ROW_FORMAT_REDUNDANT and DELETE_ROW_FORMAT_DYNAMIC.
      
      log_phys_t::apply(): If corruption was noticed, stop applying the log
      unless innodb_force_recovery is set.
      e15ae1cf
    • Marko Mäkelä's avatar
      MDEV-12353: Make UNDO_APPEND more robust · 4431144a
      Marko Mäkelä authored
      This is a follow-up to commit 84e3f9ce
      that introduced the EXTENDED log record of UNDO_APPEND subtype.
      
      mtr_t::undo_append(): Accurately enforce the mtr_buf_t::MAX_DATA_SIZE
      limit. Also, replace mtr_buf_t::push() with simpler code, to append 1 byte
      to the log.
      
      log_phys_t::undo_append(): Return whether the page was found to
      be in an inconsistent state.
      
      log_phys_t::apply(): If corruption was noticed, stop applying log
      unless innodb_force_recovery is set.
      4431144a
    • Sergey Vojtovich's avatar
      cleanup trailing ws · a346ff35
      Sergey Vojtovich authored
      a346ff35
    • Daniel-Solo's avatar
      MDEV-10569: Add RELEASE_ALL_LOCKS function. Implementing the SQL · 127fee99
      Daniel-Solo authored
      function to release all named locks
      127fee99
    • Sergei Golubchik's avatar
      Revert "MDEV-17554 Auto-create new partition for system versioned tables with... · 98adcffe
      Sergei Golubchik authored
      Revert "MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT"
      
      This reverts commit 9894751a.
      This reverts commit f707c83f.
      98adcffe
  8. 25 Feb, 2020 2 commits
    • Aleksey Midenkov's avatar
      Compilation fix · 9894751a
      Aleksey Midenkov authored
      9894751a
    • Aleksey Midenkov's avatar
      MDEV-17554 Auto-create new partition for system versioned tables with history... · f707c83f
      Aleksey Midenkov authored
      MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT
      
      When there are E empty partitions left, auto-create N new empty
      partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and
      marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT
      keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL
      clause.
      
      CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING
      PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT;
      
      CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING
      PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT;
      
      The current revision implements hard-coded values of 1 for E and N. As
      well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000.
      
      The name for newly added partition will be first chosen as "pX", where
      X is partition number and "p" is hard-coded name prefix. If this name
      is already occupied, the X will be incremented until the resulting
      name will be free to use.
      
      ALTER TABLE ADD PARTITION is now always fast. If there some history
      partition overflow occurs manual ALTER TABLE REBUILD PARTITION is
      needed.
      f707c83f
  9. 24 Feb, 2020 3 commits