1. 18 Dec, 2023 4 commits
  2. 17 Dec, 2023 3 commits
    • Sergei Golubchik's avatar
      MDEV-33046 race condition in InnoDB dict_stats_schedule() · aff5ed39
      Sergei Golubchik authored
      it can be invoked with ms=0. In that case dict_stats_func is
      invoked immediately, it calls dict_stats_process_entry_from_recalc_pool()
      which at the end might try to call dict_stats_schedule() again to
      queue another recalc. And it can happen that the first
      dict_stats_schedule(0) call didn't release dict_stats_mutex yet,
      so the second dict_stats_schedule() won't queue a recalc. And as a
      result the table won't have its stats recalculated at all, not now,
      not later.
      
      This causes innodb.innodb_stats_auto_recalc to fail sporadically.
      
      This commit doesn't fix it but makes it less likely to occur which happens
      to be enough for the test to pass. Proper fix is coming soon.
      aff5ed39
    • Sergei Golubchik's avatar
      Spider cannot run DDL (e.g. create tables) before ddl recovery · 0930eb86
      Sergei Golubchik authored
      use signal_ddl_recovery_done callback for that.
      
      also make the server to call signal_ddl_recovery_done() when loading
      plugins at run-time (so that plugins would't need to detect that
      on their own)
      0930eb86
    • Sergei Golubchik's avatar
      Merge branch '10.5' into 10.6 · e95bba9c
      Sergei Golubchik authored
      e95bba9c
  3. 15 Dec, 2023 1 commit
  4. 14 Dec, 2023 3 commits
    • Marko Mäkelä's avatar
      MDEV-18322 Assertion "wrong page type" on instant ALTER TABLE · 655f78a2
      Marko Mäkelä authored
      row_ins_clust_index_entry_low(): Invoke btr_set_instant() in the same
      mini-transaction that has successfully inserted the metadata record.
      In this way, if inserting the metadata record fails before any
      undo log record was written for it, the index root page will remain
      consistent.
      
      innobase_instant_try(): Remove the btr_set_instant() call.
      
      This is a 10.6 version of c17aca2f.
      
      Tested by: Matthias Leich
      Reviewed by: Thirunarayanan Balathandayuthapani
      655f78a2
    • Marko Mäkelä's avatar
      MDEV-32939 If tables are frequently created, renamed, dropped, a backup cannot be restored · f21a6cbf
      Marko Mäkelä authored
      During mariadb-backup --backup, a table could be renamed, created and
      dropped. We could have both oldname.ibd and oldname.new, and one of
      the files would be deleted before the InnoDB recovery starts. The desired
      end result would be that we will recover both oldname.ibd and newname.ibd.
      
      During normal crash recovery, at most one file operation (create, rename,
      delete) may require to be replayed from the write-ahead log before the
      DDL recovery starts.
      
      deferred_spaces.create(): In mariadb-backup --prepare, try to create the
      file in case it does not exist.
      
      fil_name_process(): Display a message about not found files not only
      if innodb_force_recovery is set, but also in mariadb-backup --prepare.
      If we are processing a FILE_RENAME for a tablespace whose recovery is
      deferred, suppress the message and adjust the file name in case
      fil_ibd_load() returns FIL_LOAD_NOT_FOUND or FIL_LOAD_DEFER.
      
      fil_ibd_load(): Remove a redundant file name comparison.
      The caller already compared that the file names are different.
      We used to wrongly return FIL_LOAD_OK instead of FIL_LOAD_ID_CHANGED
      if only the schema name differed, such as a/t1.ibd and b/t1.ibd.
      
      Tested by: Matthias Leich
      Reviewed by: Thirunarayanan Balathandayuthapani
      f21a6cbf
    • Marko Mäkelä's avatar
      0f510d8b
  5. 13 Dec, 2023 2 commits
  6. 12 Dec, 2023 10 commits
  7. 11 Dec, 2023 7 commits
    • Kristian Nielsen's avatar
      MDEV-27849: rpl.rpl_start_alter_XXX fail sporadically in buildbot · a016b18a
      Kristian Nielsen authored
      The problem is that these tests run optimistic parallel replication with
      non-transactional mysql.gtid_slave_pos table. Very occasionally InnoDB stats
      update may race with one another and cause a parallel replication deadlock
      kill after the mysql.gtid_slave_pos table has been updated. Since
      mysql.gtid_slave_pos is non-transactional, the update cannot be rolled back,
      and transaction retry will fail with a duplicate key error in
      mysql.gtid_slave_pos.
      
      Fixed by altering the storage engine to InnoDB for the table.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      a016b18a
    • Kristian Nielsen's avatar
      MDEV-32819: main.show_explain failed in buildbot · 917a7386
      Kristian Nielsen authored
      The testcase had a race in two places where a KILL QUERY is made towards a
      running query in another connection. The query can complete early so the kill
      is lost, and the test fails due to expecting ER_QUERY_INTERRUPTED.
      
      Fix by removing the KILL QUERY. It is not needed, as the query completes by
      itself after SHOW EXPLAIN FOR.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      917a7386
    • Kristian Nielsen's avatar
      MDEV-29816 rpl.rpl_parallel_29322 occasionally fails in BB · da9ffca9
      Kristian Nielsen authored
      Make sure the old binlog dump thread is not still running when manipulating
      binlog files; otherwise there is a small chance it will see an invalid
      partial file and report an I/O error.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      da9ffca9
    • Marko Mäkelä's avatar
      MDEV-16264 fixup: Remove a useless test · 1e80601b
      Marko Mäkelä authored
      Let us remove a test that frequently fails with a result difference.
      This test had been added in fc279d7e
      to cover a bug in thd_destructor_proxy(), which was replaced with
      simpler logic in 5e62b6a5 (MDEV-16264).
      1e80601b
    • Dmitry Shulga's avatar
      MDEV-31296: Crash in Item_func::fix_fields when prepared statement with... · 47f2b16a
      Dmitry Shulga authored
      MDEV-31296: Crash in Item_func::fix_fields when prepared statement with subqueries and window function is executed with sql_mode = ONLY_FULL_GROUP_BY
      
      Crash was caused by referencing a null pointer on getting
      the number of the nesting levels of the set function for the current
      select_lex at the method Item_field::fix_fields.
      
      The current select for processing is taken from Name_resolution_context
      that filled in at the function set_new_item_local_context() and
      where initialization of the data member Name_resolution_context
      was mistakenly removed by the commit
        d6ee351b
         (Revert "MDEV-24454 Crash at change_item_tree")
      
      To fix the issue, correct initialization of data member
        Name_resolution_context::select_lex
      that was removed by the commit d6ee351b
      is restored.
      47f2b16a
    • Alexander Barkov's avatar
      MDEV-17226 Column Data in Truncated on UNION to the length of the first value if using REPLACE · 03ee23bc
      Alexander Barkov authored
      This problem was earlier fixed by:
        commit 55b27888
      
      Adding MTR tests only.
      03ee23bc
    • Alexander Barkov's avatar
      MDEV-32958 Unusable key notes do not get reported for some operations · 4ced4898
      Alexander Barkov authored
      Enable unusable key notes for non-equality predicates:
         <, <=, =>, >, BETWEEN, IN, LIKE
      
      Note, in some scenarios it displays duplicate notes, e.g.
      for queries with ORDER BY:
      
        SELECT * FROM t1
        WHERE    indexed_string_column >= 10
        ORDER BY indexed_string_column
        LIMIT 5;
      
      This should be tolarable. Getting rid of the diplicate note
      completely would need a much more complex patch, which is
      not desiable in 10.6.
      
      Details:
      
      - Changing RANGE_OPT_PARAM::note_unusable_keys from bool
        to a new data type Item_func::Bitmap, so the caller can
        choose with a better granuality which predicates
        should raise unusable key notes inside the range optimizer:
          a. all predicates (=, <=>, <, <=, =>, >, BETWEEN, IN, LIKE)
          b. all predicates except equality (=, <=>)
          c. none of the predicates
      
        "b." is needed because in some scenarios equality predicates (=, <=>)
        send unusable key notes at an earlier stage, before the range optimizer,
        during update_ref_and_keys(). Calling the range optimizer with
        "all predicates" would produce duplicate notes for = and <=> in such cases.
      
      - Fixing get_quick_record_count() to call the range optimizer
        with "all predicates except equality" instead of "none of the predicates".
        Before this change the range optimizer suppressed all notes for
        non-equality predicates: <, <=, =>, >, BETWEEN, IN, LIKE.
        This actually fixes the reported problem.
      
      - Fixing JOIN::make_range_rowid_filters() to call the range optimizer
        with "all predicates except equality" instead of "all predicates".
        Before this change the range optimizer produced duplicate notes
        for = and <=> during a rowid_filter optimization.
      
      - Cleanup:
        Adding the op_collation argument to Field::raise_note_cannot_use_key_part()
        and displaying the operation collation rather than the argument collation
        in the unusable key note. This is important for operations with more than
        two arguments: BETWEEN and IN, e.g.:
      
          SELECT * FROM t1
          WHERE column_utf8mb3_general_ci
                BETWEEN 'a' AND 'b' COLLATE utf8mb3_unicode_ci;
      
          SELECT * FROM t1
          WHERE column_utf8mb3_general_ci
                IN ('a', 'b' COLLATE utf8mb3_unicode_ci);
      
          The note for 'a' now prints utf8mb3_unicode_ci as the collation.
          which is the collation of the entire operation:
      
            Cannot use key key1 part[0] for lookup:
            "`column_utf8mb3_general_ci`" of collation `utf8mb3_general_ci` >=
            "'a'" of collation `utf8mb3_unicode_ci`
      
          Before this change it printed the collation of 'a',
          so the note was confusing:
      
            Cannot use key key1 part[0] for lookup:
            "`column_utf8mb3_general_ci`" of collation `utf8mb3_general_ci` >=
            "'a'" of collation `utf8mb3_general_ci`"
      4ced4898
  8. 10 Dec, 2023 1 commit
  9. 08 Dec, 2023 3 commits
  10. 07 Dec, 2023 6 commits
    • Brandon Nesterenko's avatar
      MDEV-32953: main.rpl_mysqldump_slave Fails with "Master binlog wasn’t deleted" Assertion · 9be7e03f
      Brandon Nesterenko authored
      Because --delete-master-logs immediately purges logs after flushing,
      it is possible the binlog dump thread would still be using the old
      log when the purge executes, disallowing the file from being
      deleted.
      
      This patch institutes a work-around in the test as follows:
       1) temporarily stop the slave so there is no chance the old binlog
      is still being referenced.
       2) set master_use_gtid=Slave_pos so the slave can still appear
      up-to-date on the master after the master flushes/purges its logs
      (while the slave is offline). Otherwise (i.e. if using binlog
      file/pos), the slave would point to a purged log file, and receive
      an error immediately upon connecting to the master.
      
      Reviewed By
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      9be7e03f
    • Andrew Hutchings's avatar
      MDEV-32884 Improve S3 options comaptibility · bc5e9040
      Andrew Hutchings authored
      The previous commit for MDEV-32884 fixed the s3_protocol_version option,
      which was previous only using "Auto", no matter what it was set to. This
      patch does several things to keep the old behaviour whilst correcting
      for new behaviour and laying the groundwork for the future. This
      includes:
      
      * `Original` now means v2 protocol, which it would have been due to the
        option not working, so upgrades will stil work.
      * A new `Legacy` option has been added to mean v1 protocol.
      * Options `Path` and `Domain` have been added, these will be the only
        two options apart from `Auto` in a future release, and are more
        aligned with what this variable means.
      * Fixed the s3.debug test so that it works with v2 protocol.
      * Fixed the s3.amazon test so that it works with region subdomains.
      * Added additional modes to the s3.amazon test.
      * Added s3.not_amazon test for the remaining modes.
      
      This replaces PR #2902.
      bc5e9040
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-32242 innodb.doublewrite test case always gets skipped · d5a6ea36
      Thirunarayanan Balathandayuthapani authored
      - Split the doublewrite test into two test (doublewrite,
      doublewrite_debug) to reduce the execution time of the test
      - Removed big_test tag for the newly added test case
      - Made doublewrite test as non-debug test
      - Added search pattern to make sure that InnoDB uses doublewrite buffer
      - Replaced all kill_mysqld.inc with shutdown_mysqld.inc and
      zero shutdown timeout
      - Removed the case where fsp_flags got corrupted. Because from commit
      3da5d047 (MDEV-31851) onwards,
      doublewrite buffer removes the conversion the fsp flags from buggy
      10.1 format
      
      Thanks to Marko Mäkelä for providing the non-debug test
      d5a6ea36
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-32920 innodb_buffer_pool_read_requests always 0 · d018b909
      Thirunarayanan Balathandayuthapani authored
      srv_export_innodb_status(): Update
      export_vars.innodb_buffer_pool_read_requests
      with buf_pool.stat.n_page_gets. This is caused due
      to incorrect merge commit 44c9008b
      d018b909
    • Yuchen Pei's avatar
      Merge branch '10.4' into 10.5 · c33ca17c
      Yuchen Pei authored
      c33ca17c
    • Yuchen Pei's avatar
      Merge branch '10.4' into 10.5 · 13dd7875
      Yuchen Pei authored
      13dd7875