1. 01 Apr, 2019 2 commits
    • Marko Mäkelä's avatar
      MDEV-17380 innodb_flush_neighbors=ON should be ignored on SSD · 10dd290b
      Marko Mäkelä authored
      For tablespaces that do not reside on spinning storage, it does
      not make sense to attempt to write nearby pages when writing out
      dirty pages from the InnoDB buffer pool. It is actually detrimental
      to performance and to the life span of flash ROM storage.
      
      With this change, MariaDB will detect whether an InnoDB file resides
      on solid-state storage. The detection has been implemented for Linux
      and Microsoft Windows. For other systems, we will err on the safe side
      and assume that files reside on SSD.
      
      As part of this change, we will reduce the number of fstat() calls
      when opening data files on POSIX systems and slightly clean up some
      file I/O code.
      
      FIXME: os_is_sparse_file_supported() on POSIX works in a destructive
      manner. Thus, we can only invoke it when creating files, not when
      opening them.
      
      For diagnostics, we introduce the column ON_SSD to the table
      INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING. The table
      INNODB_SYS_TABLESPACES might seem more appropriate, but its purpose
      is to reflect the contents of the InnoDB system table SYS_TABLESPACES,
      which we would like to remove at some point.
      
      On Microsoft Windows, querying StorageDeviceSeekPenaltyProperty
      sometimes returns ERROR_GEN_FAILURE instead of ERROR_INVALID_FUNCTION
      or ERROR_NOT_SUPPORTED. We will silently ignore also this error,
      and assume that the file does not reside on SSD.
      
      On Linux, the detection will be based on the files
      /sys/block/*/queue/rotational and /sys/block/*/dev.
      Especially for USB storage, it is possible that
      /sys/block/*/queue/rotational will wrongly report 1 instead of 0.
      
      fil_node_t::on_ssd: Whether the InnoDB data file resides on
      solid-state storage.
      
      fil_system_t::ssd: Collection of Linux block devices that reside on
      non-rotational storage.
      
      fil_system_t::create(): Detect ssd on Linux based on the contents
      of /sys/block/*/queue/rotational and /sys/block/*/dev.
      
      fil_system_t::is_ssd(dev_t): Determine if a Linux block device is
      non-rotational. Partitions will be identified with the containing
      block device by assuming that the least significant 4 bits of the
      minor number identify a partition, and that the "partition number"
      of the entire device is 0.
      10dd290b
    • Alexander Barkov's avatar
      2d825e97
  2. 29 Mar, 2019 5 commits
  3. 28 Mar, 2019 2 commits
  4. 27 Mar, 2019 1 commit
  5. 26 Mar, 2019 13 commits
  6. 25 Mar, 2019 13 commits
    • Daniel Bartholomew's avatar
      bump the VERSION · b30bbb7d
      Daniel Bartholomew authored
      b30bbb7d
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 8b480df6
      Marko Mäkelä authored
      8b480df6
    • Marko Mäkelä's avatar
      Fix the Windows build · 07096ada
      Marko Mäkelä authored
      btr_cur_compress_recommendation(): Backport a change from 10.3.
      
      This is a follow-up to commit 1bd98154.
      07096ada
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · dbc0d576
      Marko Mäkelä authored
      dbc0d576
    • Marko Mäkelä's avatar
      MDEV-19022: InnoDB fails to cleanup useless B-tree pages · 525e79b0
      Marko Mäkelä authored
      The test case for reproducing MDEV-14126 demonstrates that InnoDB can
      end up with an index tree where a non-leaf page has only one child page.
      
      The test case innodb.innodb_bug14676111 demonstrates that such pages
      are sometimes unavoidable, because InnoDB does not implement any sort
      of B-tree rotation.
      
      But, there is no reason to allow a root page with only one child page.
      
      btr_cur_node_ptr_delete(): Replaces btr_node_ptr_delete().
      
      btr_page_get_father(): Declare globally.
      
      btr_discard_only_page_on_level(): Declare with ATTRIBUTE_COLD.
      It turns out that this function is not covered by the
      innodb.innodb_bug14676111 test case after all.
      
      btr_discard_page(): If the root page ends up having only one child
      page, shrink the tree by invoking btr_lift_page_up().
      525e79b0
    • Marko Mäkelä's avatar
      Avoid sign mismatch in comparisons · ade0a0e9
      Marko Mäkelä authored
      This is follow-up to commit 1bd98154.
      ade0a0e9
    • Marko Mäkelä's avatar
      MDEV-14126: Fix type mismatch · 1bd98154
      Marko Mäkelä authored
      Backport some changes to B-tree page accessor functions from 10.3,
      including changing page_get_n_recs() to return uint16_t.
      1bd98154
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · c3a6c683
      Marko Mäkelä authored
      c3a6c683
    • Marko Mäkelä's avatar
      MDEV-14126: Detect unexpected emptying of B-tree pages · 72b934e3
      Marko Mäkelä authored
      If an index page becomes empty, btr_page_empty() should be called.
      72b934e3
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      MDEV-14126: Remove page_is_root() · b59d4846
      Marko Mäkelä authored
      The predicate page_is_root(), which was added in MariaDB Server 10.2.2,
      is based on a wrong assumption.
      
      Under some circumstances, InnoDB can transform B-trees into a degenerate
      state where a non-leaf page has no sibling pages. Because of this,
      we cannot assume that a page that has no siblings is the root page.
      This bug will be tracked as MDEV-19022.
      
      Because of the bug that may affect many InnoDB data files, we must remove
      and replace the wrong predicate. Using the wrong predicate can cause
      corruption. A leaf page is not allowed to be empty except if it is the
      root page, and the entire table is empty.
      b59d4846
    • Marko Mäkelä's avatar
      MDEV-18090 Assertion failures due to virtual columns after upgrading to 10.2 · 71c781bf
      Marko Mäkelä authored
      MariaDB before MDEV-5800 in version 10.2.2 did not support
      indexed virtual columns. Non-persistent virtual columns were
      hidden from storage engines. Only starting with MDEV-5800, InnoDB
      would create internal metadata on virtual columns.
      
      Similar to what was done in MDEV-18084 and MDEV-18960, we adjust two more
      code paths for the old tables.
      
      ha_innobase::build_template(): Do not invoke
      dict_index_contains_col_or_prefix() for virtual columns if InnoDB
      does not store the metadata.
      
      innobase_build_col_map(): Relax an assertion about the number of columns.
      
      ha_innobase::omits_virtual_cols(): Renamed from omits_virtual_cols().
      71c781bf
    • Alexander Barkov's avatar
      SEQUENCE tests for MDEV-18892 Regression in slow log and admin statements · f03f4da6
      Alexander Barkov authored
      Adding tests to cover how SEQUENCE related statements work in combination
      with the slow log configuration commands.
      f03f4da6
  7. 23 Mar, 2019 4 commits