1. 09 Oct, 2019 1 commit
  2. 08 Oct, 2019 2 commits
  3. 07 Oct, 2019 1 commit
  4. 04 Oct, 2019 5 commits
  5. 03 Oct, 2019 1 commit
  6. 01 Oct, 2019 7 commits
    • Jan Lindström's avatar
      97d82c34
    • seppo's avatar
      MDEV-20225 BF aborting SP execution (#1394) · c42c4233
      seppo authored
      * MDEV-20225 BF aborting SP execution
      
      When stored procedure execution was chosen as victim for a BF abort, the old implemnetationn called for rollback immediately
      when execution was inside SP isntruction. Technically this happened in wsrep_after_statement() call, which identified the
      need for a rollback.
      The problem was that MariaDB does not accept rollback (nor commit) inside sub statement, there are several asserts about it,
      checking for THD::in_sub_stmt.
      
      This patch contains a fix, which skips calling wsrep_after_statement() for SP execution, which is marked as BF must abort. Instead,
      we return error code to upper level, where rollback will eventually happen, ouside of SP execution.
      Also, appending the affected trigger table (dropped or created) in the populated key set for the write set,
      which prevents parallel applying of other transactions working on the same table.
      
      * MDEV-20225 BF aborting SP execution, second patch
      
      First PR missed 4 commits, which are now squashed in this patch:
      - Added galera_sp_bf_abort test.
        A MTR test case which will reproduce BF-BF conflict if all keys
        corresponding to affected tables are not assigned for DROP TRIGGER.
      - Fixed incorrect use of sync pointsin MDEV-20225
      - Added condition for SQLCOM_DROP_TRIGGER in wsrep_can_run_in_toi()
        to make it replicate.
      
      * MDEV-20225 BF aborting SP execution, third patch
      
      The galera_trigger.test caused a situation, where SP invocation caused a trigger
      to fire, and the trigger executed as sub statement SP, and was BF aborted by applier.
      because of wsrep_after_statement() was called for the sub-statement level, it ended up
      in exeuting rollback and asserted there.
      Thus fix will catch sub-statement level SP execution, and avoids calling wsrep_after_statement()
      c42c4233
    • Alexander Barkov's avatar
      dc588e3d
    • Alexander Barkov's avatar
      7e44c455
    • Alexander Barkov's avatar
      f203245e
    • Alexander Barkov's avatar
      4bcf5244
    • Alexander Barkov's avatar
  7. 30 Sep, 2019 5 commits
    • Robert Bindar's avatar
      MDEV-20647 Fix and enable SphinxSE tests · 576a5f09
      Robert Bindar authored
      576a5f09
    • Alexey Botchkov's avatar
      MDEV-19628 JSON with starting double quotes key is not valid. · 6c2724fc
      Alexey Botchkov authored
      Make the skip_key a bit faster.
      6c2724fc
    • Alexey Botchkov's avatar
      MDEV-19628 JSON with starting double quotes key is not valid. · 6ac2a355
      Alexey Botchkov authored
      First character of the key name is just skipped, so the escapement
      wasn't handled properly.
      6ac2a355
    • Marko Mäkelä's avatar
      Fix -Wunused for CMAKE_BUILD_TYPE=RelWithDebInfo · 46b78526
      Marko Mäkelä authored
      For release builds, do not declare unused variables.
      
      unpack_row(): Omit a debug-only variable from WSREP diagnostic message.
      
      create_wsrep_THD(): Fix -Wmaybe-uninitialized for the PSI_thread_key.
      46b78526
    • Sujatha's avatar
      MDEV-20645: Replication consistency is broken as workers miss the error... · 9b80f930
      Sujatha authored
      MDEV-20645: Replication consistency is broken as workers miss the error notification from an earlier failed group.
      
      Analysis:
      ========
      In general if there are three groups.
      1 - Inserts 32 which fails due to local entry '32' on slave.
      2 - Inserts 33
      3 - Inserts 34
      
      Each group considers itself as a waiter and it waits for prior group 'waitee'.
      This is done in 'register_wait_for_prior_event_group_commit'. If there is no
      other parallel group being scheduled then no waitee will be there.
      
      Let us assume 3 groups are being scheduled in parallel.
      
      3-> waits for 2-> waits for->1
      
      '1' upon completion it checks is there any registered subsequent waiter. If
      so it wakes up the subsequent waiter with its execution status. This execution
      status is stored in wakeup_error.
      
      If '1' failed then it sends corresponding wakeup_error to 2. Then '2' aborts
      and it propagates error to '3'.  So all further commits are aborted.  This
      mechanism works only when all transactions reach a stage where they are
      waiting for their prior commit to complete.
      
      In case of optimistic following scenario occurs.
      
      1,2,3 are scheduled in parallel.
      
      3 - Reaches group_commit_code waits for 2 to complete.
      1 - errors out sets stop_on_error_sub_id=1.
      
      When a group execution results in error its corresponding sub_id is set to
      'stop_on_error_sub_id'. Any new groups queued for execution will check if
      their sub_id is > stop_on_error_sub_id.  If it is true their execution will be
      skipped as prior group execution failed.  'skip_event_group=1' will be set.
      Since the execution of SQL thread is about to stop we just skip execution of
      all the following event groups.  We still do all the normal waiting and wakeup
      processing between the event groups as a simple way to ensure that everything
      is stopped and cleaned up correctly.
      
      Upon error '1' transaction checks for registered waiters. Since no one is
      there it simply goes away.
      
      2 - Starts the execution. It checks do I have a waitee.
      
      Since wait_commit_sub_id == entry->last_committed_sub_id no waitee is set.
      
      Secondly: 'entry->stop_on_error_sub_id' is set by '1'st execution.  Now
      'handle_parallel_thread' code checks if the current group 'sub_id' is greater
      than the 'sub_id' set within 'stop_on_error_sub_id'.
      
      Since the above is true 'skip_event_group=true' is set.  Simply call
      'wait_for_prior_commit' to wakeup all waiters.  Group '2' didn't had any
      waitee and its execution is skipped.  Hence its wakeup_error=0.It sends a
      positive wakeup signal to '3'. Which commits. This results in a missed
      transaction. i.e 33 is missed and 34 is committed.
      
      Fix:
      ===
      When a worker learns that an earlier transaction execution has failed, and it
      should not proceed for further execution, it should mark its own execution
      status as failed so that it alerts its followers to abort as well.
      9b80f930
  8. 28 Sep, 2019 1 commit
  9. 27 Sep, 2019 10 commits
    • Julius Goryavsky's avatar
      MDEV-20614: Syntax error, and option put in wrong place · bc70862e
      Julius Goryavsky authored
      A syntax error in the mysqld_multi.sh script has been fixed
      here + a "--defaults-group-suffix" option has been moved to
      the top of the mysqld options list.
      bc70862e
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 9b5cdeeb
      Marko Mäkelä authored
      9b5cdeeb
    • Marko Mäkelä's avatar
      MDEV-20117: Fix another scenario · ea2b19de
      Marko Mäkelä authored
      Thanks to Eugene Kosov for noting that the fix is incomplete.
      It turns out that on instant DROP/reorder column (MDEV-15562),
      we must always write the metadata record, even though the table
      was empty. Alternatively, we should guarantee that all undo
      log records for the table have been purged. (Attempting to do
      that by updating table_id leads to other problems; see
      commit 1b31d885.)
      
      It would be tempting to remove dict_index_t::clear_instant_alter()
      altogether, but it turns that we need that when the instant ALTER TABLE
      operation of a first-time DROP COLUMN is being rolled back.
      
      innobase_instant_try(): Clarify a comment. Purge never calls
      dict_index_t::clear_instant_alter(), but it may invoke
      dict_index_t::clear_instant_add(). On first-time instant DROP/reorder,
      always write a metadata record, even if the table is empty.
      ea2b19de
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 2911a9a6
      Marko Mäkelä authored
      2911a9a6
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-20688 Recovery crashes after unnecessarily reading a corrupted page · c76873f2
      Thirunarayanan Balathandayuthapani authored
      The test encryption.innodb-redo-badkey was accidentally disabled
      until commit 23657a21 enabled
      it recently. Once it was enabled, it started failing randomly.
      
      recv_recover_corrupt_page(): Do not assume that any redo log exists
      for the page. A page may be unnecessarily read by read-ahead.
      When noting the corruption, reset recv_addr->state to RECV_PROCESSED,
      so that even if the same page is re-read again, we will only
      decrement recv_sys->n_addrs once.
      c76873f2
    • Marko Mäkelä's avatar
      dict_load_table(): Remove constant parameter cached=true · d874cdec
      Marko Mäkelä authored
      Spotted by Thirunarayanan Balathandayuthapani.
      d874cdec
    • Marko Mäkelä's avatar
      Reduce rw_lock_debug_mutex contention · 718fcee0
      Marko Mäkelä authored
      rw_lock_own(), rw_lock_own_flagged(): Traverse the rw_lock_t::debug_list
      only after quickly checking if the thread is holding X-latch or SX-latch.
      718fcee0
    • Sergei Golubchik's avatar
      chkconfig in RPM server scriptlets · 677cc644
      Sergei Golubchik authored
      chkconfig --add and --del [might] invoke /sbin/insserv
      and even if chkconfig exists, insserv might not (SLES15).
      
      Ignore chkconfig --del errors - it's a "best effort" cleanup anyway
      677cc644
    • Marko Mäkelä's avatar
      Remove a useless large test, and add a debug assertion · 4ec0c346
      Marko Mäkelä authored
      The test innodb_fts.fulltext_table_evict was only creating 1000 tables
      with fulltext indexes, only to check that no tables with fulltext
      indexes are being evicted.
      
      The reason why tables containing fulltext indexes cannot be evicted is
      that fts_optimize_init() invokes dict_table_prevent_eviction().
      4ec0c346
    • Marko Mäkelä's avatar
      MDEV-19740: Fix GCC 9.2.1 -Wmaybe-uninitialized on AMD64 · ca9e0089
      Marko Mäkelä authored
      For CMAKE_BUILD_TYPE=Debug, the default MYSQL_MAINTAINER_MODE=AUTO
      implies -Werror along with other flags in cmake/maintainer.cmake,
      which would break the debug builds when CMAKE_CXX_FLAGS include -O2.
      
      This fix includes a backport of 6dd3f240
      from MariaDB 10.3.
      ca9e0089
  10. 26 Sep, 2019 7 commits
    • Marko Mäkelä's avatar
      MDEV-20117 Assertion 0 failed in row_sel_get_clust_rec_for_mysql · 1f4ee3fa
      Marko Mäkelä authored
      The crash scenario is as follows:
      
      (1) A non-empty table exists.
      (2) MDEV-15562 instant ADD/DROP/reorder has been invoked.
      (3) Some purgeable undo log exists for the table.
      (4) The table becomes empty, containing not even any delete-marked records,
      only containing the hidden metadata record that was added in (2).
      (5) An instant ADD/DROP/reorder column is executed, and the table
      is emptied and the (2) metadata removed.
      (6) Purge processes an undo log record from (3), which will refer to
      a non-existent clustered index field, because the metadata that
      was created in (2) was remoeved in (5).
      
      We fix this by adjusting step (5) so that we will never remove the
      MDEV-15562-style metadata record. Removing the MDEV-11369 metadata
      record (instant ADD COLUMN to the end of the table) is completely
      fine at any time when the table becomes empty, because
      dict_index_t::n_fields will remain unchanged.
      
      innobase_instant_try(): Never remove the MDEV-15562 metadata record.
      
      page_cur_delete_rec(): Do not reset FIL_PAGE_TYPE when the
      MDEV-15562 metadata record is being removed as part of
      btr_cur_pessimistic_update() invoked by innobase_instant_try().
      1f4ee3fa
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · bb5afc7c
      Marko Mäkelä authored
      bb5afc7c
    • Marko Mäkelä's avatar
      Fix GCC 9 -Wmaybe-uninitialized · 46facaed
      Marko Mäkelä authored
      Always initialize ScopedStatementReplication::saved_binlog_format,
      so that GCC cannot emit a bogus warning about
      ScopedStatementReplication::~ScopedStatementReplication() using the
      variable.
      
      The code was originally introduced in
      commit d998da03.
      46facaed
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1cf0694d
      Marko Mäkelä authored
      1cf0694d
    • Marko Mäkelä's avatar
      MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5 · 3e4931cd
      Marko Mäkelä authored
      lock_print_info::operator(): Do not dereference purge_sys.query in case
      it is NULL. We would not initialize purge_sys if innodb_force_recovery
      is set to 5 or 6.
      
      The test case will be added by merge from 10.2.
      3e4931cd
    • Marko Mäkelä's avatar
      MDEV-19514 preparation: Extend innodb.innodb-change-buffer-recovery · 2d6719d7
      Marko Mäkelä authored
      Test innodb_read_only startup (which will be refused after a crash),
      and test also innodb_force_recovery=5, and extract some change buffer
      merge statistics. Omit any statistics about delete (purge) buffering,
      because purge could happen at any time.
      
      Use the sequence storage engine for populating the table.
      2d6719d7
    • Marko Mäkelä's avatar
      MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5 · 23d67545
      Marko Mäkelä authored
      Add a test case. MariaDB Server 10.2 is not affected.
      23d67545