1. 28 Feb, 2017 7 commits
    • Monty's avatar
      Add protection for reinitialization of mutex in parallel replaction · a2de378c
      Monty authored
      Added mutex_lock/mutex_unlock of mutex that is to be destroyed in
      wait_for_commit::reinit() in a similar fashion that we do in
      ~wait_for_commit
      a2de378c
    • Monty's avatar
      Added a separate lock for start/stop/reset slave. · c5e25c8b
      Monty authored
      This solves some possible dead locks when one calls stop slave while slave
      is starting.
      c5e25c8b
    • Monty's avatar
      MDEV-9573 'Stop slave' hangs on replication slave · e65f667b
      Monty authored
      The reason for this is that stop slave takes LOCK_active_mi over the
      whole operation while some slave operations will also need LOCK_active_mi
      which causes deadlocks.
      
      Fixed by introducing object counting for Master_info and not taking
      LOCK_active_mi over stop slave or even stop_all_slaves()
      
      Another benefit of this approach is that it allows:
      - Multiple threads can run SHOW SLAVE STATUS at the same time
      - START/STOP/RESET/SLAVE STATUS on a slave will not block other slaves
      - Simpler interface for handling get_master_info()
      - Added some missing unlock of 'log_lock' in error condtions
      - Moved rpl_parallel_inactivate_pool(&global_rpl_thread_pool) to end
        of stop_slave() to not have to use LOCK_active_mi inside
        terminate_slave_threads()
      - Changed argument for remove_master_info() to Master_info, as we always
        have this available
      - Fixed core dump when doing FLUSH TABLES WITH READ LOCK and parallel
        replication. Problem was that waiting for pause_for_ftwrl was not done
        when deleting rpt->current_owner after a force_abort.
      e65f667b
    • Monty's avatar
      Fixed compiler warnings · d5c54f39
      Monty authored
      - Removed not used variables
      - Added __attribute__()
      - Added static to some local functions
        (gcc 5.4 gives a warning for external functions without an external definition)
      d5c54f39
    • iangilfillan's avatar
      Update MariaDB Foundation sponsors · ce903428
      iangilfillan authored
      ce903428
    • Vladislav Vaintroub's avatar
    • Marko Mäkelä's avatar
      MDEV-12127 InnoDB: Assertion failure loop_count < 5 in file log0log.cc · fc673a2c
      Marko Mäkelä authored
      As suggested in MySQL Bug#58536, increase the limit in this
      debug assertion in order to avoid false positives on heavily
      loaded systems.
      fc673a2c
  2. 27 Feb, 2017 2 commits
    • Daniel Black's avatar
      MDEV-11619: mtr --mem {no argument of a directory} (#320) · b54566d7
      Daniel Black authored
      This removes functionality of where ./mtr --mem /tmp/dir could be a directory.
      
      Now MTR_MEM=/tmp/dir ./mtr is needed.
      
      The case where MTR_MEM=/tmp/dir ./mtr --mem has the equivalent effect.
      Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
      
      --mem works better as a pure flag, because it can be followed by command-line arguments (test names). If the option is allowed to have a value, the test name which directly follows it will be treated as the option value instead. It is possible to implement workarounds to avoid this, but they would not be completely reliable, and there is no practical purpose of such extension of functionality to justify them.
      b54566d7
    • Oleksandr Byelkin's avatar
      MDEV-11935: Queries in stored procedures with and EXISTS(SELECT * FROM VIEW)... · e5b877ce
      Oleksandr Byelkin authored
      MDEV-11935: Queries in stored procedures with and EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton.
      
      Use correct start point even for taken out from subselect items in process of exists2in conversion.
      e5b877ce
  3. 26 Feb, 2017 1 commit
  4. 23 Feb, 2017 1 commit
  5. 22 Feb, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-11520 post-fix · a0ce92dd
      Marko Mäkelä authored
      fil_extend_space_to_desired_size(): Use a proper type cast when
      computing start_offset for the posix_fallocate() call on 32-bit systems
      (where sizeof(ulint) < sizeof(os_offset_t)). This could affect 32-bit
      systems when extending files that are at least 4 MiB long.
      
      This bug existed in MariaDB 10.0 before MDEV-11520. In MariaDB 10.1
      it had been fixed in MDEV-11556.
      a0ce92dd
    • Marko Mäkelä's avatar
      MDEV-11520 Extending an InnoDB data file unnecessarily allocates · 81695ab8
      Marko Mäkelä authored
      a large memory buffer on Windows
      
      fil_extend_space_to_desired_size(), os_file_set_size(): Use calloc()
      for memory allocation, and handle failures. Properly check the return
      status of posix_fallocate(), and pass the correct arguments to
      posix_fallocate().
      
      On Windows, instead of extending the file by at most 1 megabyte at a time,
      write a zero-filled page at the end of the file.
      According to the Microsoft blog post
      https://blogs.msdn.microsoft.com/oldnewthing/20110922-00/?p=9573
      this will physically extend the file by writing zero bytes.
      (InnoDB never uses DeviceIoControl() to set the file sparse.)
      
      I tested that the file extension works properly with a multi-file
      system tablespace, both with --innodb-use-fallocate and
      --skip-innodb-use-fallocate (the default):
      
      ./mtr \
      --mysqld=--innodb-use-fallocate \
      --mysqld=--innodb-autoextend-increment=1 \
      --mysqld=--innodb-data-file-path='ibdata1:5M;ibdata2:5M:autoextend' \
      --parallel=auto --force --retry=0 --suite=innodb &
      
      ls -lsh mysql-test/var/*/mysqld.1/data/ibdata2
      (several samples while running the test)
      81695ab8
  6. 21 Feb, 2017 1 commit
  7. 20 Feb, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-11802 innodb.innodb_bug14676111 fails · 13493078
      Marko Mäkelä authored
      The function trx_purge_stop() was calling os_event_reset(purge_sys->event)
      before calling rw_lock_x_lock(&purge_sys->latch). The os_event_set()
      call in srv_purge_coordinator_suspend() is protected by that X-latch.
      
      It would seem a good idea to consistently protect both os_event_set()
      and os_event_reset() calls with a common mutex or rw-lock in those
      cases where os_event_set() and os_event_reset() are used
      like condition variables, tied to changes of shared state.
      
      For each os_event_t, we try to document the mutex or rw-lock that is
      being used. For some events, frequent calls to os_event_set() seem to
      try to avoid hangs. Some events are never waited for infinitely, only
      timed waits, and os_event_set() is used for early termination of these
      waits.
      
      os_aio_simulated_put_read_threads_to_sleep(): Define as a null macro
      on other systems than Windows. TODO: remove this altogether and disable
      innodb_use_native_aio on Windows.
      
      os_aio_segment_wait_events[]: Initialize only if innodb_use_native_aio=0.
      13493078
    • Marko Mäkelä's avatar
      Revert the MDEV-4396 tweak to innodb.innodb_bug14676111. · 72994d64
      Marko Mäkelä authored
      MDEV-11802 aims to fix the root cause instead.
      72994d64
  8. 19 Feb, 2017 3 commits
    • Elena Stepanova's avatar
      MDEV-10631 rpl.rpl_mdev6386 failed in buildbot · 343ba585
      Elena Stepanova authored
      The failure happens due to a race condition between processing
      a row event (INSERT) and an automatically generated event
      DROP TEMPORARY TABLE. Even though DROP has a higher GTID, it can
      become visible in @@gtid_slave_pos before the row event with
      a lower GTID has been committed. Since the test makes the slave
      to synchronize with the master using GTID, the waiting stops
      as soon as GTID of the DROP TEMPORARY TABLE becomes visible,
      and if changes from the previous event haven't been applied yet,
      the error occurs.
      
      According to Kristian (see the comment to MDEV-10631), the real
      problem is that DROP TEMPORARY TABLE is logged in the row mode
      at all. For this particular test, since DROP does not do anything,
      nothing prevents it from competing with the prior transaction.
      
      The workaround for the test is to add a meaningful event
      after DROP TEMPORARY TABLE, so that the slave would wait on its
      GTID instead of the one from DROP.
      
      Additionally (unrelated to this problem) removed FLUSH TABLES,
      which, as the comment stated, should have been removed after
      MDEV-6403 was fixed.
      343ba585
    • Elena Stepanova's avatar
      MDEV-11766 Tests failed in buildbot with semaphore waiting warnings · 72a822f2
      Elena Stepanova authored
      The standalone warning is not a sign of a problem, just of slowness,
      so it should be added to global suppressions. If a real problem
      happens, there will be other errors
      72a822f2
    • Daniel Black's avatar
      MDEV-11619: mtr --mem and $MTR_MEM support in sane and consistent manner (10.0) (#289) · 5e42c958
      Daniel Black authored
      * Revert "Make --mem a pure flag. If there is need to specifically set the location"
      
      This reverts commit 716621db.
      
      * MDEV-11619: mtr: when --mem is pure flag, conflicts with $MTR_MEM
      
      Conflicts occurs when MTR_MEM=/xxx/yy ./mtr --mem is invoked. Here
      the --mem option overrides opt_mem leaving the default path to be chosen.
      
      This change makes when MTR_MEM set, opt_mem, the flag, is also
      set. Both the environment and flag can no be set without conflicting.
      Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
      
      * MDEV-11619: if opt_mem is a path include it first
      
      * MDEV-11619: MTR_MEM locations - don't follow symlinks
      
      From Bjorn Munch it seems symlinks can confuse some
      tests. Lets just avoid those.
      
      (ref: https://github.com/mysql/mysql-server/pull/116#issuecomment-268479774)
      Signed-off-by: default avatarDaniel Black <daniel.black@au.ibm.com>
      5e42c958
  9. 16 Feb, 2017 1 commit
  10. 09 Feb, 2017 1 commit
  11. 08 Feb, 2017 1 commit
  12. 05 Feb, 2017 1 commit
    • Marko Mäkelä's avatar
      Rewrite the innodb.log_file_size test with DBUG_EXECUTE_IF. · f1627045
      Marko Mäkelä authored
      Remove the debug parameter innodb_force_recovery_crash that was
      introduced into MySQL 5.6 by me in WL#6494 which allowed InnoDB
      to resize the redo log on startup.
      
      Let innodb.log_file_size actually start up the server, but ensure
      that the InnoDB storage engine refuses to start up in each of the
      scenarios.
      f1627045
  13. 04 Feb, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-11985 Make innodb_read_only shutdown more robust · 20e83474
      Marko Mäkelä authored
      If InnoDB is started in innodb_read_only mode such that
      recovered incomplete transactions exist at startup
      (but the redo logs are clean), an assertion will fail at shutdown,
      because there would exist some non-prepared transactions.
      
      logs_empty_and_mark_files_at_shutdown(): Do not wait for incomplete
      transactions to finish if innodb_read_only or innodb_force_recovery>=3.
      Wait for purge to finish in only one place.
      
      trx_sys_close(): Relax the assertion that would fail first.
      
      trx_free_prepared(): Also free recovered TRX_STATE_ACTIVE transactions
      if innodb_read_only or innodb_force_recovery>=3.
      20e83474
    • Marko Mäkelä's avatar
      MDEV-11947 InnoDB purge workers fail to shut down · 9f0dbb31
      Marko Mäkelä authored
      srv_release_threads(): Actually wait for the threads to resume
      from suspension. On CentOS 5 and possibly other platforms,
      os_event_set() may be lost.
      
      srv_resume_thread(): A counterpart of srv_suspend_thread().
      Optionally wait for the event to be set, optionally with a timeout,
      and then release the thread from suspension.
      
      srv_free_slot(): Unconditionally suspend the thread. It is always
      in resumed state when this function is entered.
      
      srv_active_wake_master_thread_low(): Only call os_event_set().
      
      srv_purge_coordinator_suspend(): Use srv_resume_thread() instead
      of the complicated logic.
      9f0dbb31
  14. 03 Feb, 2017 1 commit
  15. 01 Feb, 2017 4 commits
  16. 30 Jan, 2017 1 commit
  17. 27 Jan, 2017 3 commits
    • Marko Mäkelä's avatar
      Clean up a few tests that kill the server. · 4e82aaab
      Marko Mäkelä authored
      As noted in MDEV-8841, any test that kills the server must issue
      FLUSH TABLES, so that tables of crash-unsafe storage engines will
      not be corrupted. Consistently issue this statement after any
      call mtr.add_suppression() calls.
      
      Also, do not invoke shutdown_server directly, but use helpers instead.
      4e82aaab
    • Marko Mäkelä's avatar
      MDEV-11814 test fix · ea9caea8
      Marko Mäkelä authored
      Do not kill the server after call mtr.add_suppression(), because
      the procedure modifies a crash-unsafe table, and we do not want to
      corrupt that table.
      ea9caea8
    • Marko Mäkelä's avatar
      MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes · 732672c3
      Marko Mäkelä authored
      crashes server
      
      This bug is the result of merging the Oracle MySQL follow-up fix
      BUG#22963169 MYSQL CRASHES ON CREATE FULLTEXT INDEX
      without merging the base bug fix:
      Bug#79475 Insert a token of 84 4-bytes chars into fts index causes
      server crash.
      
      Unlike the above mentioned fixes in MySQL, our fix will not change
      the storage format of fulltext indexes in InnoDB or XtraDB
      when a character encoding with mbmaxlen=2 or mbmaxlen=3
      and the length of a word is between 128 and 84*mbmaxlen bytes.
      The Oracle fix would allocate 2 length bytes for these cases.
      
      Compatibility with other MySQL and MariaDB releases is ensured by
      persisting the used maximum length in the SYS_COLUMNS table in the
      InnoDB data dictionary.
      
      This fix also removes some unnecessary strcmp() calls when checking
      for the legacy default collation my_charset_latin1
      (my_charset_latin1.name=="latin1_swedish_ci").
      
      fts_create_one_index_table(): Store the actual length in bytes.
      This metadata will be written to the SYS_COLUMNS table.
      
      fts_zip_initialize(): Initialize only the first byte of the buffer.
      Actually the code should not even care about this first byte, because
      the length is set as 0.
      
      FTX_MAX_WORD_LEN: Define as HA_FT_MAXCHARLEN * 4 aka 336 bytes,
      not as 254 bytes.
      
      row_merge_create_fts_sort_index(): Set the actual maximum length of the
      column in bytes, similar to fts_create_one_index_table().
      
      row_merge_fts_doc_tokenize(): Remove the redundant parameter word_dtype.
      Use the actual maximum length of the column. Calculate the extra_size
      in the same way as row_merge_buf_encode() does.
      732672c3
  18. 26 Jan, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-11915 Detect InnoDB system tablespace size mismatch early · afb46158
      Marko Mäkelä authored
      InnoDB would refuse to start up if there is a mismatch on
      the size of the system tablespace files. However, before this
      check is conducted, the system tablespace may already have been
      heavily modified.
      
      InnoDB should perform the size check as early as possible.
      
      recv_recovery_from_checkpoint_finish():
      Move the recv_apply_hashed_log_recs() call to
      innobase_start_or_create_for_mysql().
      
      innobase_start_or_create_for_mysql(): Test the mutex functionality
      before doing anything else. Use a compile_time_assert() for a
      sizeof() constraint. Check the size of the system tablespace as
      early as possible.
      afb46158
    • Marko Mäkelä's avatar
      MDEV-11814 Refuse innodb_read_only startup if crash recovery is needed · 49fe9bad
      Marko Mäkelä authored
      recv_scan_log_recs(): Remember if redo log apply is needed,
      even if starting up in innodb_read_only mode.
      
      recv_recovery_from_checkpoint_start_func(): Refuse
      innodb_read_only startup if redo log apply is needed.
      49fe9bad
  19. 23 Jan, 2017 1 commit
  20. 20 Jan, 2017 1 commit
    • Sachin Setiya's avatar
      MDEV-4774 Strangeness with max_binlog_stmt_cache_size Settings · 18ef02b0
      Sachin Setiya authored
      Problem:- When setting max_binlog_stmt_cache_size=18446744073709547520
      from either command line or .cnf file, server fails to start.
      
      Solution:- Added one more function eval_num_suffix_ull , which uses
      strtoull to get unsigned ulonglong from string. And getopt_ull calls this
      function instead of eval_num_suffix. Also changed previous eval_num_suffix to
      eval_num_suffix_ll to remain consistent.
      18ef02b0
  21. 17 Jan, 2017 2 commits