Commit graph

199315 commits

Author SHA1 Message Date
Daniel Black
c8d52c895d MDEV-24670 memory pressure - warnings/notes
Silence a few more un-actionable warnings.

Use ignoring result on write to make sure compilers
don't complain.
2023-12-21 20:05:05 +11:00
Sergei Golubchik
c712a5302b fix test failures with ASAN
ASAN uses *a lot* more stack. use not_asan.inc for tests
that recursively put a lot of data on the stack
2023-12-21 10:21:05 +02:00
Yuchen Pei
c73417c68e
MDEV-32986 Make regexp operator work in spider group by handler
In spider_db_mbase_util::print_item_func(), if the sql item_func has
an UNKNOWN_FUNC type, by default the spider group by handler (gbh)
transform infix to prefix. But regexp should remain infix, so we add
an if condition to account for this.
2023-12-21 10:31:12 +11:00
Jan Lindström
cfaab614ea MDEV-24481 : galera_3nodes.galera_vote_rejoin_mysqldump MTR failed: mysql_shutdown failed
Improve test case to wait until cluster membership is
correct.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2023-12-20 15:29:47 +01:00
Marko Mäkelä
2b99e5f7ef Merge 10.6 into 10.11 2023-12-20 15:58:36 +02:00
Marko Mäkelä
f9ae553067 MDEV-33098: Disable the test 2023-12-20 15:56:00 +02:00
Julius Goryavsky
96e49c76a8 Revert "MDEV-32964: Expect DB_INTERRUPTED from wsrep_row_upd_check_foreign_constraints"
This reverts commit ddd8a90812 (additional correction required)
2023-12-20 14:20:40 +01:00
Sergei Petrunia
2b8c59fffa Fix main.type_timestamp: Change 10.10 in "End of 10.10 tests" to 10.5 2023-12-20 14:51:00 +03:00
Daniele Sciascia
0e1f4bd661 MDEV-31272 Statement rollback causes empty writeset replication
This patch fixes cases where a transaction caused empty writeset to be
replicated. This could happen in the case where a transaction executes
a statement that initially manages to modify some data and therefore
appended keys some for  certification. The statement is however rolled
back at some later stage due to some error (for example, a duplicate
key error). After statement rollback the transaction is still alive,
has no other changes. When committing such transaction, an empty
writeset was replicated through Galera.

The fix is to avoid calling into commit hook only when transaction
has appended one or keys for certification *and* has some data in
binlog cache to replicate. Otherwise, the commit is considered empty,
and goes through usual empty commit path.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2023-12-20 12:31:17 +01:00
Denis Protivensky
ddd8a90812 MDEV-32964: Expect DB_INTERRUPTED from wsrep_row_upd_check_foreign_constraints
Remove DB_LOCK_WAIT return code check as it should have been resolved to
one of the other errors by that point.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2023-12-20 12:31:17 +01:00
Jan Lindström
148cbf2aed MDEV-32995 : Remove not supported tests from wsrep suite
Changes to be committed:

	modified:   mysql-test/suite/wsrep/disabled.def
	deleted:    mysql-test/suite/wsrep/r/MDEV-22443.result
	deleted:    mysql-test/suite/wsrep/r/MDEV-23092.result
	deleted:    mysql-test/suite/wsrep/r/mdev_6832.result
	deleted:    mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result
	deleted:    mysql-test/suite/wsrep/t/MDEV-22443.cnf
	deleted:    mysql-test/suite/wsrep/t/MDEV-22443.test
	deleted:    mysql-test/suite/wsrep/t/MDEV-23092.cnf
	deleted:    mysql-test/suite/wsrep/t/MDEV-23092.test
	deleted:    mysql-test/suite/wsrep/t/mdev_6832.cnf
	deleted:    mysql-test/suite/wsrep/t/mdev_6832.test
	deleted:    mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf
	deleted:    mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test

These test cases used feature not available anymore.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2023-12-20 12:31:17 +01:00
Julius Goryavsky
87ae34ac83 galera: updating the list of disabled tests 2023-12-20 12:31:17 +01:00
Daniel Black
9d2c3d388e MDEV-24670 memory pressure - warnings/notes
Errors outputted as notes are weird, and when a user
cannot do anything about them, why output them at all.

Point taken, removed these, and left positive message
on initialization (from Marko).

Thanks Elena Stepanova.
2023-12-20 17:55:50 +11:00
Marko Mäkelä
a057a6e41f MDEV-24670 memory pressure - mariadb-backup postfix
mariadb-backup wasn't meant to have memory pressure
sensors so restrict the operation to SRV_OPERATIONAL_NORMAL
mode.

Reviewed by Daniel Black.
2023-12-20 09:53:46 +11:00
Marko Mäkelä
2b01e5103d Merge 10.5 into 10.6 2023-12-19 18:41:42 +02:00
Marko Mäkelä
12995559f9 Merge 10.4 into 10.5 2023-12-19 18:30:58 +02:00
Marko Mäkelä
476ff0927a MDEV-33062 innodb_undo_log_truncate=ON prevents fast shutdown
trx_purge_truncate_history(): If a fast shutdown has been initiated,
disregard innodb_undo_log_truncate=ON and return.
2023-12-19 14:45:39 +02:00
Kristian Nielsen
eaa4968fc5 MDEV-10653: Fix segfault in SHOW MASTER STATUS with NULL inuse_relaylog
The previous patch for MDEV-10653 changes the rpl_parallel::workers_idle()
function to use Relay_log_info::last_inuse_relaylog to check for idle
workers. But the code was missing a NULL check. Also, there was one place
during SQL slave thread start which was missing mutex synchronisation when
updating inuse_relaylog.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2023-12-19 12:08:54 +01:00
Kristian Nielsen
1cbba45e6e Attempt to fix rare race in test for MDEV-8031
The error-injection inject_mdev8031 simulates a deadlock kill in a specific
place, by setting killed_for_retry to RETRY_KILL_KILLED directly. If a real
deadlock kill triggers at the same time, it is possible for the thread to
complete its transaction retry and set rgi_slave to NULL before the real
readlock kill can complete in the background. This will cause a segfault
due to null-pointer access.

Fix by changing the error injection to do a real background deadlock kill,
which ensures that the thread will wait for any pending background kills to
complete.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2023-12-19 12:08:53 +01:00
Kristian Nielsen
a204ce2788 MDEV-33045: Server crashes in Item_func_binlog_gtid_pos::val_str / Binary_string::c_ptr_safe
Item::val_str() sets the Item::null_value flag, so call it before checking
the flag, not after.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2023-12-19 12:08:53 +01:00
Marko Mäkelä
98287bd2d6 MDEV-33009 Server hangs for a long time with innodb_undo_log_truncate=ON
trx_purge_truncate_history(): Release buf_pool.flush_list_mutex
and 'dummily' acquire and release buf_pool.mutex before starting
a rescan of buf_pool.flush_list, to ensure that
the buf_flush_page_cleaner thread (which may be holding buf_pool.mutex)
will be able to proceed.

This fixes up commit 5dbe7a8c9a (MDEV-32757).

Tested by: Axel Schwenke (on Ubuntu 18.04 and Ubuntu 20.04)
Reviewed by: Vladislav Lesin
2023-12-19 11:15:08 +02:00
hsser
be694384d4 MDEV-31925 Fix for File Leak in mysql_upgrade with --check-if-upgrade-is-needed Option
This commit addresses the file leakage problem encountered with the mysql_upgrade --check-if-upgrade-is-needed command.
2023-12-19 19:30:02 +11:00
Sergei Golubchik
25c627885a hashicorp plugin: any 404 from the vault means "no key found"
e.g. it could be

{"errors":["no handler for route \"mariadbtest/data/1\". route entry not found."]}
2023-12-18 23:05:58 +01:00
Sergei Golubchik
eb37a76659 fix test failures with ASAN
ASAN uses *a lot* more stack. use not_asan.inc for tests
that recursively put a lot of data on the stack
2023-12-18 22:13:23 +01:00
Sergei Golubchik
11ae6c9af1 InnoDB: downgrade a warning to a note
"InnoDB: The last skipped log record LSN X is not equal to page LSN Y"
is not an actionable message for the user, so it should be a note, not
a warning
2023-12-18 17:42:50 +01:00
Sergei Golubchik
07a0173f1c perfschema: LOCK_all_status_vars not LOCK_status
to iterate over all status variables one should use
LOCK_all_status_vars not LOCK_status

this fixes sporadic mutex lock inversion in plugins.password_reuse_check:
* acl_cache->lock is taken over complex operations that might increment
  status counters (under LOCK_status).
* acl_cache->lock is needed to get the values of Acl% status variables
  when iterating over status variables
2023-12-18 17:37:30 +01:00
Sergei Golubchik
fd0b47f9d6 Merge branch '10.6' into 10.11 2023-12-18 11:19:04 +01:00
Marko Mäkelä
4c2e971841 MDEV-33052 MSAN use-of-uninitialized-value in buf_read_ahead_linear()
buf_read_ahead_linear(): Suppress a warning of comparing potentially
uninitialized FIL_PAGE_PREV and FIL_PAGE_NEXT fields.
2023-12-18 10:37:11 +02:00
Marko Mäkelä
4ae105a37d Merge 10.4 into 10.5 2023-12-18 08:59:07 +02:00
Sergei Golubchik
aff5ed3988 MDEV-33046 race condition in InnoDB dict_stats_schedule()
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.
2023-12-17 11:20:56 +01:00
Sergei Golubchik
0930eb86cb Spider cannot run DDL (e.g. create tables) before ddl recovery
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)
2023-12-17 11:20:51 +01:00
Sergei Golubchik
e95bba9c58 Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
Marko Mäkelä
f98d2ef5b4 MDEV-33009 Server hangs for a long time with innodb_undo_log_truncate=ON
trx_purge_truncate_history(): Release buf_pool.flush_list_mutex
before starting a rescan of buf_pool.flush_list, to ensure that
the buf_flush_page_cleaner thread (which may be holding buf_pool.mutex)
will be able to proceed.

This fixes up commit a0f02f7438 (MDEV-32757).

Tested by: Axel Schwenke
Reviewed by: Vladislav Lesin
2023-12-15 15:38:31 +02:00
Sergei Golubchik
87a5d16911 add another missing result file
see also 4eca64e331
2023-12-15 12:11:26 +01:00
Thirunarayanan Balathandayuthapani
59a984b4d8 MDEV-32725 innodb.import_update_stats accesses uninitialized ib_table->stat_n_rows
- InnoDB should write all zeros into a table and its indexes
statistics members when table is unreadable.
2023-12-15 15:43:19 +05:30
Thirunarayanan Balathandayuthapani
686865e112 Adjust the MDEV-26052 test case for MDEV-29092 2023-12-15 15:30:09 +05:30
Sergei Golubchik
a2c6d61db8 don't use dynstr_append() in mysqltest.cc
followup for ad796aaa94
2023-12-15 10:26:48 +01:00
Sisi Huang
c5d7036e1a MDEV-32942 Fix Memory Leak in my_print_defaults with Non-Existing Config Files 2023-12-15 10:22:40 +11:00
Sergei Golubchik
4eca64e331 add missing result file 2023-12-14 20:25:58 +01:00
Marko Mäkelä
655f78a238 MDEV-18322 Assertion "wrong page type" on instant ALTER TABLE
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 c17aca2f11.

Tested by: Matthias Leich
Reviewed by: Thirunarayanan Balathandayuthapani
2023-12-14 15:24:19 +02:00
Marko Mäkelä
f21a6cbf6e MDEV-32939 If tables are frequently created, renamed, dropped, a backup cannot be restored
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
2023-12-14 13:16:28 +02:00
Marko Mäkelä
0f510d8b5a MDEV-32751 fixup: cmake -DPLUGIN_PERFSCHEMA=NO 2023-12-14 13:15:51 +02:00
Marko Mäkelä
852e1383e3 MDEV-21245 InnoDB: Using a partial-field key prefix in search
ha_innobase::compare_key_parts(): If a full column index is
being replaced with a column prefix index, return Compare_keys::NotEqual.
2023-12-14 09:57:38 +11:00
Daniel Black
2c60d43d7d MDEV-33006 Missing required privilege CONNECTION ADMIN
opt_kill_long_query_type being an enum could be 0 corresponding
to ALL. When ALL is specified, the CONNECTION ADMIN is still
required.

Also check REPLICA MONITOR privilege and make the tests
find the results by recording stderr.

Noticed thanks to bug report by Tim van Dijen.

Fixes: 79b58f1ca8
2023-12-14 09:08:43 +11:00
Rex
b4712242dd MDEV-31279 Crash when lateral derived is guaranteed to return no rows
Consider this query
SELECT t1.* FROM t1, (SELECT t2.b FROM t2 WHERE NOT EXISTS
(SELECT 1 FROM t3) GROUP BY b) sq where sq.b = t1.a;

If SELECT 1 FROM t3 is expensive, for example t3 has >
thd->variables.expensive_subquery_limit, first evaluation is deferred to
mysql_derived_fill().  There it is noted that, in the above case
 NOT EXISTS (SELECT 1 FROM t3) is constant and false.

This causes the join variable zero_result_cause to be set to
"Impossible WHERE noticed after reading const tables" and the handler
for this join is never "opened" via handler::ha_open.

When mysql_derived_fill() is called for the next group of results, this
unopened handler is not taken into account.

reviewed by Igor Babaev (igor@mariadb.com)
2023-12-14 06:14:24 +12:00
Marko Mäkelä
c17aca2f11 MDEV-18322 Assertion "wrong page type" on instant ALTER TABLE
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.

Reviewed by: Thirunarayanan Balathandayuthapani
Tested by: Matthias Leich
2023-12-13 15:01:50 +02:00
Sergei Golubchik
9a7deb1c36 MDEV-32542 plugins.compression - multiple buildbot failures
more robust plugins.compression test
2023-12-13 12:47:21 +01:00
Daniel Black
fbe604d883 MDEV-32795: ALTER SEQUENCE IF NOT EXISTS non_existing_seq Errors rather than note
Like all IF NOT EXISTS syntax, a Note should be generated.

The original commit of Seqeuences cleared the IF NOT EXISTS part
in the sql/sql_yacc.yy with lex->create_info.init(). Without this
bit set there was no way it could do anything other than error.

To remedy this removal, the sql_yacc.yy components have been
minimised as they where all set at the beginning of the ALTER.
This way the opt_if_not_exists correctly set the IF_EXISTS flag.

In MDEV-13005 (bb4dd70e7c) the error code changed, requiring
ER_UNKNOWN_SEQUENCES to be handled in the function
No_such_table_error_handler::handle_condition.
2023-12-13 17:48:03 +11:00
Sergei Golubchik
736a54f49c perfschema: use LOCK_thd_kill to "keep THD during materialization"
fixes the failure of

./mtr --ps sys_vars.gtid_slave_pos_grant sysschema.v_session_ssl_status

safe_mutex: Found wrong usage of mutex 'LOCK_thd_data' and 'LOCK_active_mi'
2023-12-13 00:37:57 +01:00
Daniel Black
7504985daf MDEV-21587: disk.disk{_notembedded} test result
Allow for a CI system to be almost out of space, or having so
little use, that the Total space is the same as available or used.

Thanks Otto Kekäläinen for the bug report and testing.
2023-12-13 08:54:39 +11:00