1. 28 Oct, 2019 4 commits
  2. 25 Oct, 2019 4 commits
  3. 24 Oct, 2019 1 commit
  4. 23 Oct, 2019 1 commit
  5. 19 Oct, 2019 4 commits
  6. 17 Oct, 2019 3 commits
    • Marko Mäkelä's avatar
      Simplify row_undo_ins_remove_sec_low() · fa929f7c
      Marko Mäkelä authored
      Reduce the scope of some variables, remove a goto and a redundant
      assertion.
      
      For B-tree secondary indexes, this function can remove a delete-marked
      purgeable record, in case a row rollback of the INSERT was initiated
      due to an error in an earlier secondary index.
      fa929f7c
    • Marko Mäkelä's avatar
      b0278302
    • Marko Mäkelä's avatar
      MDEV-20852 BtrBulk is unnecessarily holding dict_index_t::lock · fa32d28f
      Marko Mäkelä authored
      The BtrBulk class, which was introduced in MySQL 5.7, is by design
      the exclusive writer to an index. It is therefore unnecessary to
      acquire the dict_index_t::lock in that code.
      
      Holding the dict_index_t::lock would unnecessarily block other threads
      (SQL connections and the InnoDB purge threads) from buffering concurrent
      modifications to being-created secondary indexes.
      
      This fix is motivated by a change in MySQL 5.7.28:
      Bug #29008298 MYSQLD CRASHES ITSELF WHEN CREATING INDEX
      mysql/mysql-server@f9fb96c20f9d190f654e7aa2387255bf80fd6e45
      
      PageBulk::init(), PageBulk::latch(): Never acquire m_index->lock.
      
      PageBulk::storeExt(): Remove some pointer indirection, and improve
      a debug assertion that seems to prove that some code is redundant.
      
      BtrBulk::pageCommit(): Assert that m_index->lock is not being held.
      
      btr_blob_log_check_t: Do not acquire m_index->lock if
      m_op == BTR_STORE_INSERT_BULK. Add UNIV_UNLIKELY hints around
      that condition.
      
      btr_store_big_rec_extern_fields(): Allow index->lock not to be held
      while op == BTR_STORE_INSERT_BULK. Add UNIV_UNLIKELY hints around
      that condition.
      fa32d28f
  7. 16 Oct, 2019 1 commit
    • Monty's avatar
      Fixed bug in lock tables + alter table with Aria tables. · 3ce14a66
      Monty authored
      MDEV-18451 Server crashes in maria_create_trn_for_mysql
      upon ALTER TABLE
      
      Problem was that when table was locked many times, not all
      instances where removed from the transaction by
      _ma_remove_table_from_trnman()
      3ce14a66
  8. 15 Oct, 2019 4 commits
  9. 14 Oct, 2019 5 commits
    • Eugene Kosov's avatar
      MDEV-20778 UBSAN: call to function free_rpl_filter() through pointer to incorrect function type · 4d147855
      Eugene Kosov authored
      Proper C-style type erasure is done via void*, not via char* or something else.
      
      free_key_cache()
      free_rpl_filter(): types were fixed to avoid function pointer type cast which
      is still undefined behavior.
      
      Note, that casting from void* to any other pointer type is safe and correct.
      4d147855
    • Marko Mäkelä's avatar
      MDEV-20813: Do not rotate keys for unallocated pages · f989c0ce
      Marko Mäkelä authored
      fil_crypt_rotate_page(): Skip the key rotation for pages that carry 0
      in FIL_PAGE_TYPE. This avoids not only unnecessary writes, but also
      failures of the recently added debug assertion in
      buf_flush_init_for_writing() that the FIL_PAGE_TYPE should be nonzero.
      
      Note: the debug assertion can fail if the file was originally created
      before MySQL 5.5. In old InnoDB versions, FIL_PAGE_TYPE was only
      initialized for B-tree pages, to FIL_PAGE_INDEX. For any other pages,
      the field could be garbage, including FIL_PAGE_INDEX. In MariaDB 10.2
      and later, buf_flush_init_for_writing() would initialize the
      FIL_PAGE_TYPE on such old pages, but only after passing the debug
      assertion that insists that pages have a nonzero FIL_PAGE_TYPE.
      Thus, the debug assertion at the start of buf_flush_init_for_writing()
      can fail when upgrading from very old debug files. This assertion is
      only present in debug builds, not release builds.
      f989c0ce
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 4f9f3f19
      Marko Mäkelä authored
      Do not merge the InnoDB changes for MDEV-20813.
      4f9f3f19
    • Marko Mäkelä's avatar
      MDEV-20813: Remove the buf_flush_init_for_writing() assertion · ae702d76
      Marko Mäkelä authored
      Old InnoDB/XtraDB versions only initialized FIL_PAGE_TYPE for
      B-tree pages (to FIL_PAGE_INDEX), and left it uninitialized
      (possibly containing FIL_PAGE_INDEX) for others. In MySQL
      or MariaDB 5.5, the field is initialized on almost all pages,
      but still not all of them.
      
      In MariaDB 10.2 and later, buf_flush_init_for_writing() would
      initialize the FIL_PAGE_TYPE on such old pages, but only after
      passing the debug assertion that we are now removing from 10.1.
      There, we will be able to modify fil_crypt_rotate_page() so
      that it will skip the key rotation for pages that contain 0
      in FIL_PAGE_TYPE.
      
      In MariaDB 10.1, there is no logic that would initialize
      FIL_PAGE_TYPE on data pages in old data files after an update.
      So, encryption key rotation may routinely cause page flushes
      on pages that contain 0 in FIL_PAGE_TYPE.
      ae702d76
    • Marko Mäkelä's avatar
      MDEV-19740: Fix C++11 violations caught by GCC 9.2.1 · 2920377a
      Marko Mäkelä authored
      This is a backport of commit ec28f953
      to MariaDB Server 10.1.
      2920377a
  10. 12 Oct, 2019 2 commits
    • Marko Mäkelä's avatar
      MDEV-20813 Assertion failure in buf_flush_init_for_writing() for... · 361e8284
      Marko Mäkelä authored
      MDEV-20813 Assertion failure in buf_flush_init_for_writing() for innodb_immediate_scrub_data_uncompressed=ON
      
      The assertion that was added in
      commit c0c003be
      to augment the fix of MDEV-20805 turns out to be invalid when
      innodb_immediate_scrub_data_uncompressed is enabled.
      In this mode, fsp_init_file_page() will be invoked on data pages
      that have been freed, causing writes of almost-all-zero pages.
      
      btr_page_free(): Adjust the comment.
      
      buf_flush_init_for_writing(): Disable the assertion with a note
      that it should be re-enabled in MDEV-15528.
      361e8284
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 2227dec4
      Marko Mäkelä authored
      2227dec4
  11. 11 Oct, 2019 11 commits
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 2ae02c29
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      2ae02c29
    • Julius Goryavsky's avatar
      MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1 · 4ca0abe9
      Julius Goryavsky authored
      When the mysqld_multi script passes the --defaults-group-suffix
      option to mysqld, it must remove the initial substring with the
      group name ("mysqld") from option value, because otherwise substring
      "mysqld" will be added to the group name and then the group name
      will contain the word "mysqld" twice, which is wrong, because
      mysqld itself adds the suffix received to the group name.
      4ca0abe9
    • Marko Mäkelä's avatar
      Fix -std=c++98 -Wzero-length-array · 38736928
      Marko Mäkelä authored
      This is another follow-up fix to
      commit b393e2cb
      which turned out to be still broken.
      
      Replace the C++11 keyword 'constexpr' with #define.
      
      debug_sync_t::str: Remove the zero-length array.
      Replace sync->str with reinterpret_cast<char*>(&sync[1]).
      38736928
    • Marko Mäkelä's avatar
      After-merge fix: Correct an assertion · 1e1b53cc
      Marko Mäkelä authored
      During IMPORT TABLESPACE, we do invoke
      buf_flush_init_for_writing() with block==NULL and newest_lsn!=0.
      1e1b53cc
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 966d97b5
      Marko Mäkelä authored
      966d97b5
    • Marko Mäkelä's avatar
      Fix CMAKE_BUILD_TYPE=Debug · 1fd1ef25
      Marko Mäkelä authored
      Remove unused variables and type mismatch that was introduced
      in commit b393e2cb
      
      Also, fix a typo in the documentation of the parameter, and
      update the test.
      1fd1ef25
    • Marko Mäkelä's avatar
      MDEV-20805 follow-up: Catch writes of bogus pages · c0c003be
      Marko Mäkelä authored
      buf_flush_init_for_writing(): Assert that FIL_PAGE_TYPE is set
      except when creating a new data file with a dummy first page.
      
      buf_dblwr_create(): Ensure that FIL_PAGE_TYPE on all pages
      will be initialized. Reset buf_dblwr_being_created at the end.
      c0c003be
    • Marko Mäkelä's avatar
      Merge 5.5 into 10.1 · cbfd6882
      Marko Mäkelä authored
      cbfd6882
    • Marko Mäkelä's avatar
      MDEV-20805 ibuf_add_free_page() is not initializing FIL_PAGE_TYPE first · ea61b796
      Marko Mäkelä authored
      In the function recv_parse_or_apply_log_rec_body() there are debug checks
      for validating the state of the page when redo log records are being
      applied. Most notably, FIL_PAGE_TYPE should be set before anything else
      is being written to the page.
      
      ibuf_add_free_page(): Set FIL_PAGE_TYPE before performing any other changes.
      ea61b796
    • Marko Mäkelä's avatar
      MDEV-19455: Avoid SET DEBUG_DBUG='-d,...' construct · 4ebaf813
      Marko Mäkelä authored
      Apply the correct pattern for debug instrumentation:
      
      SET @save_dbug=@@debug_dbug;
      SET debug_dbug='+d,...';
      ...
      SET debug_dbug=@save_dbug;
      
      Numerous tests use statements of the form
      
      SET debug_dbug='-d,...';
      
      which will inadvertently enable all DBUG tracing output,
      causing unnecessary waste of resources.
      4ebaf813
    • Marko Mäkelä's avatar
      MDEV-20804 Speed up main.index_merge_innodb · 5ef12244
      Marko Mäkelä authored
      The test main.index_merge_innodb is taking very much time,
      especially on later versions (10.2 and 10.3).
      
      Some of this could be attributed to the use of INSERT...SELECT,
      which is time-consumingly creating explicit record locks in InnoDB
      for the locking read in the SELECT part.
      
      In 10.3 and later, some slowness can be attributed to MDEV-12288,
      which makes the InnoDB purge thread spend time to reset transaction
      identifiers in the inserted records. If we prevent purge from
      running before all tables are dropped, the test seems to be
      10% faster on an unoptimized debug build on 10.5. (A proper fix
      would be to implement MDEV-515 and stop writing row-level undo log
      records for inserts into an empty table or partition.)
      
      At the same time, it should not hurt to make main.index_merge_myisam
      to use the sequence engine. Not only could it be a little faster,
      but the test would be slightly more readable.
      5ef12244