1. 27 Apr, 2017 9 commits
    • Vladislav Vaintroub's avatar
      d7714308
    • Vladislav Vaintroub's avatar
      MDEV-9566 Prepare xtradb for xtrabackup · 9c4b7cad
      Vladislav Vaintroub authored
      These changes are comparable to Percona's modifications in innodb in the
      Percona Xtrabackup repository.
      
      - If functions are used in backup as well as in innodb, make them non-static.
      
      - Define IS_XTRABACKUP() macro for special handling of innodb running
        inside backup.
      
      - Extend some functions for backup.
        fil_space_for_table_exists_in_mem() gets additional parameter
        'remove_from_data_dict_if_does_not_exist', for partial backups
      
        fil_load_single_table_tablespaces() gets an optional parameter predicate
        which tells whether to load tablespace based on database or table name,
        also for partial backups.
      
        srv_undo_tablespaces_init() gets an optional parameter 'backup_mode'
      
      - Allow single redo log file (for backup "prepare")
      
      - Do not read doublewrite buffer pages in backup, they are outdated
      
      - Add function fil_remove_invalid_table_from_data_dict(), to remove non-existing
         tables from data dictionary in case of partial backups.
      
      - On Windows, fix file share modes when opening tablespaces,
      to allow mariabackup to read tablespaces while server is online.
      
      - Avoid access to THDVARs in backup, because innodb plugin is not loaded,
      and THDVAR would crash in this case.
      9c4b7cad
    • Vladislav Vaintroub's avatar
      MDEV-9566 Server code changes in preparation for mariabackup · f06ab0fc
      Vladislav Vaintroub authored
      - Backup will  load encryption plugins outside of mysqld. Thus, do not
      force loading MyISAM plugin in plugin_load.
      
      - init_signals() will be used in backup,  make it global, not static.
      f06ab0fc
    • Vladislav Vaintroub's avatar
      MDEV-9566 prepare mysqltest for mariabackup · ec68f764
      Vladislav Vaintroub authored
      - Do not throw output of exec command, if disable_result_log is set
      save and dump it if exec fails. Need tha to meaningfully analyze
      errors from mariabackup.
      
      - rmdir now removes the entire tree. need that because xtrabackup tests
      clean the whole directory.
      
      - all filesystem modifying commands now require the argument to
        be under MYSQLTEST_VARDIR or MYSQL_TMP_DIR.
      ec68f764
    • Vladislav Vaintroub's avatar
      MDEV-11660 Make encryption plugins "pure" · 7bf40959
      Vladislav Vaintroub authored
      Do not exporting mysqld entry points directly.
      This is needed for mariabackup, to load encryption plugins on Windows.
      
      All plugins are "pure" by default. To mark plugin "impure"
      it should use RECOMPILE_FOR_EMBEDDED or STORAGE_ENGINE keyword.
      7bf40959
    • Vladislav Vaintroub's avatar
      MDEV-11663 Create services for functionality used by plugins · db391074
      Vladislav Vaintroub authored
      Added service for
      - encryption (AES)
      - error reporting, e.g my_printf_error()
      db391074
    • Sergei Golubchik's avatar
      175dd3ad
    • Sergei Golubchik's avatar
      bugfix: federated/replication did not increment bytes_received status variable · 99e1294c
      Sergei Golubchik authored
      because mysql->net.thd was reset to NULL in mysql_real_connect()
      and thd_increment_bytes_received() didn't do anything.
      
      Fix:
      * set mysql->net.thd to current_thd instread.
      * remove the test for non-null THD from a very often used
        function thd_increment_bytes_received().
      99e1294c
    • Sergei Golubchik's avatar
      don't generate wsrep_sst_common in-place · 2c3f5787
      Sergei Golubchik authored
      rename the source to wsrep_sst_common.sh
      2c3f5787
  2. 26 Apr, 2017 1 commit
    • Jan Lindström's avatar
      MDEV-12253: Buffer pool blocks are accessed after they have been freed · 765a4360
      Jan Lindström authored
      Problem was that bpage was referenced after it was already freed
      from LRU. Fixed by adding a new variable encrypted that is
      passed down to buf_page_check_corrupt() and used in
      buf_page_get_gen() to stop processing page read.
      
      This patch should also address following test failures and
      bugs:
      
      MDEV-12419: IMPORT should not look up tablespace in
      PageConverter::validate(). This is now removed.
      
      MDEV-10099: encryption.innodb_onlinealter_encryption fails
      sporadically in buildbot
      
      MDEV-11420: encryption.innodb_encryption-page-compression
      failed in buildbot
      
      MDEV-11222: encryption.encrypt_and_grep failed in buildbot on P8
      
      Removed dict_table_t::is_encrypted and dict_table_t::ibd_file_missing
      and replaced these with dict_table_t::file_unreadable. Table
      ibd file is missing if fil_get_space(space_id) returns NULL
      and encrypted if not. Removed dict_table_t::is_corrupted field.
      
      Ported FilSpace class from 10.2 and using that on buf_page_check_corrupt(),
      buf_page_decrypt_after_read(), buf_page_encrypt_before_write(),
      buf_dblwr_process(), buf_read_page(), dict_stats_save_defrag_stats().
      
      Added test cases when enrypted page could be read while doing
      redo log crash recovery. Also added test case for row compressed
      blobs.
      
      btr_cur_open_at_index_side_func(),
      btr_cur_open_at_rnd_pos_func(): Avoid referencing block that is
      NULL.
      
      buf_page_get_zip(): Issue error if page read fails.
      
      buf_page_get_gen(): Use dberr_t for error detection and
      do not reference bpage after we hare freed it.
      
      buf_mark_space_corrupt(): remove bpage from LRU also when
      it is encrypted.
      
      buf_page_check_corrupt(): @return DB_SUCCESS if page has
      been read and is not corrupted,
      DB_PAGE_CORRUPTED if page based on checksum check is corrupted,
      DB_DECRYPTION_FAILED if page post encryption checksum matches but
      after decryption normal page checksum does not match. In read
      case only DB_SUCCESS is possible.
      
      buf_page_io_complete(): use dberr_t for error handling.
      
      buf_flush_write_block_low(),
      buf_read_ahead_random(),
      buf_read_page_async(),
      buf_read_ahead_linear(),
      buf_read_ibuf_merge_pages(),
      buf_read_recv_pages(),
      fil_aio_wait():
              Issue error if page read fails.
      
      btr_pcur_move_to_next_page(): Do not reference page if it is
      NULL.
      
      Introduced dict_table_t::is_readable() and dict_index_t::is_readable()
      that will return true if tablespace exists and pages read from
      tablespace are not corrupted or page decryption failed.
      Removed buf_page_t::key_version. After page decryption the
      key version is not removed from page frame. For unencrypted
      pages, old key_version is removed at buf_page_encrypt_before_write()
      
      dict_stats_update_transient_for_index(),
      dict_stats_update_transient()
              Do not continue if table decryption failed or table
              is corrupted.
      
      dict0stats.cc: Introduced a dict_stats_report_error function
      to avoid code duplication.
      
      fil_parse_write_crypt_data():
              Check that key read from redo log entry is found from
              encryption plugin and if it is not, refuse to start.
      
      PageConverter::validate(): Removed access to fil_space_t as
      tablespace is not available during import.
      
      Fixed error code on innodb.innodb test.
      
      Merged test cased innodb-bad-key-change5 and innodb-bad-key-shutdown
      to innodb-bad-key-change2.  Removed innodb-bad-key-change5 test.
      Decreased unnecessary complexity on some long lasting tests.
      
      Removed fil_inc_pending_ops(), fil_decr_pending_ops(),
      fil_get_first_space(), fil_get_next_space(),
      fil_get_first_space_safe(), fil_get_next_space_safe()
      functions.
      
      fil_space_verify_crypt_checksum(): Fixed bug found using ASAN
      where FIL_PAGE_END_LSN_OLD_CHECKSUM field was incorrectly
      accessed from row compressed tables. Fixed out of page frame
      bug for row compressed tables in
      fil_space_verify_crypt_checksum() found using ASAN. Incorrect
      function was called for compressed table.
      
      Added new tests for discard, rename table and drop (we should allow them
      even when page decryption fails). Alter table rename is not allowed.
      Added test for restart with innodb-force-recovery=1 when page read on
      redo-recovery cant be decrypted. Added test for corrupted table where
      both page data and FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION is corrupted.
      
      Adjusted the test case innodb_bug14147491 so that it does not anymore
      expect crash. Instead table is just mostly not usable.
      
      fil0fil.h: fil_space_acquire_low is not visible function
      and fil_space_acquire and fil_space_acquire_silent are
      inline functions. FilSpace class uses fil_space_acquire_low
      directly.
      
      recv_apply_hashed_log_recs() does not return anything.
      765a4360
  3. 25 Apr, 2017 1 commit
  4. 24 Apr, 2017 2 commits
  5. 21 Apr, 2017 11 commits
  6. 20 Apr, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-12534 Use atomic operations whenever available · d34a67b0
      Marko Mäkelä authored
      Allow 64-bit atomic operations on 32-bit systems,
      only relying on HAVE_ATOMIC_BUILTINS_64, disregarding
      the width of the register file.
      
      Define UNIV_WORD_SIZE correctly on all systems, including Windows.
      In MariaDB 10.0 and 10.1, it was incorrectly defined as 4 on
      64-bit Windows.
      
      Define HAVE_ATOMIC_BUILTINS_64 on Windows
      (64-bit atomics are available on both 32-bit and 64-bit Windows
      platforms; the operations were unnecessarily disabled even on
      64-bit Windows).
      
      MONITOR_OS_PENDING_READS, MONITOR_OS_PENDING_WRITES: Enable by default.
      
      os_file_n_pending_preads, os_file_n_pending_pwrites,
      os_n_pending_reads, os_n_pending_writes: Remove.
      Use the monitor counters instead.
      
      os_file_count_mutex: Remove. On a system that does not support
      64-bit atomics, monitor_mutex will be used instead.
      d34a67b0
    • Daniel Black's avatar
      OSX: get cache line size · 5136295b
      Daniel Black authored
      5136295b
  7. 19 Apr, 2017 1 commit
  8. 17 Apr, 2017 2 commits
  9. 10 Apr, 2017 1 commit
    • Kristian Nielsen's avatar
      MDEV-11201: gtid_ignore_duplicates incorrectly ignores statements when GTID... · 88613e1d
      Kristian Nielsen authored
      MDEV-11201: gtid_ignore_duplicates incorrectly ignores statements when GTID replication is not enabled
      
      When master_use_gtid=no, the IO thread loads the slave GTID state from
      the master during connect. This races with the SQL thread when
      gtid_ignore_duplicates=1. If an event is in the relay log from before
      the new connect and has not been applied yet, moving the slave
      position causes the SQL thread to think that event should be skipped
      due to gtid_ignore_duplicates=1.
      
      This patch simply disables gtid_ignore_duplicates when not using GTID,
      which seems to be what one would expect.
      88613e1d
  10. 09 Apr, 2017 1 commit
  11. 06 Apr, 2017 9 commits