Commit graph

196018 commits

Author SHA1 Message Date
Marko Mäkelä
da21f3f428 Merge 10.5 into 10.6 2022-11-10 17:30:15 +02:00
Marko Mäkelä
7ee612c912 MDEV-21174 fixup: Remove mtr_t::release_page()
mtr_t::release_page(): Remove. The function became unused in
commit 56f6dab1d0
when the call was replaced with a call to mtr_t::memo_release().
2022-11-10 12:50:44 +02:00
Marko Mäkelä
fef9d6ef1d Add STATS_PERSISTENT=0 to a test
This fixes up commit 314ed9f5ec
and commit 9608773f75
2022-11-10 09:21:51 +02:00
Marko Mäkelä
6b671aeee3 MDEV-29710: Disable some more tests on Valgrind
A number of tests often trip warnings on Valgrind, because Valgrind
runs all threads in a single thread and may cause starvation:
InnoDB: A long wait (... seconds) was observed for dict_sys.latch

Let us disable those tests on Valgrind in order to avoid bogus failures.
2022-11-10 08:54:57 +02:00
asklavou
7aa8b209df MDEV-29866: Add RESET MASTER to clear possible remaining binlog from previous test 2022-11-09 17:36:42 +00:00
Marko Mäkelä
a75ec07b42 MDEV-27234 fixup: Remove a bogus assertion
Starting with commit 8f8ba75855
the assertion would fail in
./mtr --mysqld=--innodb-adaptive-hash-index innodb.instant_alter_crash
and it would keep failing even after
commit d2e649aec2
2022-11-09 16:45:36 +02:00
asklavou
e616c9a0ef MDEV-28970: Add RESET MASTER to clear possible remaining binlog from previous test 2022-11-09 11:59:28 +00:00
Marko Mäkelä
e56c12b3cd Add an end marker to a test 2022-11-09 12:02:04 +02:00
Marko Mäkelä
ab44e1f87c Merge 10.5 into 10.6 2022-11-09 09:32:58 +02:00
Marko Mäkelä
3278c57917 Merge 10.4 into 10.5 2022-11-09 09:30:37 +02:00
Marko Mäkelä
20969aa412 Merge 10.3 into 10.4 2022-11-09 09:28:39 +02:00
Marko Mäkelä
6b91792a08 MDEV-29883 Deadlock between InnoDB statistics update and BLOB insert
This is a backport of commit 8b6a308e46
from MariaDB Server 10.6.11. No attempt to reproduce the hang
in earlier an earlier version of MariaDB Server than 10.6 was made.

In each caller of fseg_n_reserved_pages() except ibuf_init_at_db_start()
which is a special case for ibuf.index at database startup, we must hold
an index latch that prevents concurrent allocation or freeing of index
pages.

Any operation that allocates or free pages that belong to an index tree
must first acquire an index latch in non-shared mode, and while
holding that, acquire an index root page latch in non-shared mode.

btr_get_size(), btr_get_size_and_reserved(): Assert that a strong enough
index latch is being held.

dict_stats_update_transient_for_index(),
dict_stats_analyze_index(): Acquire a strong enough index latch.

These operations had followed the same order of acquiring latches in
every InnoDB version since the very beginning
(commit c533308a15).

The hang was introduced in
commit 2e814d4702 which imported
mysql/mysql-server@ac74632293
which failed to strengthen the locking requirements of the function
btr_get_size().
2022-11-09 09:23:18 +02:00
Marko Mäkelä
b955f4eff7 MDEV-22512: Re-enable the tests on 10.5 2022-11-08 18:21:39 +02:00
Andrew Hutchings
fda5846704
MDEV-29397 CONNECT engine: Fix note turning into error (#2325)
* MDEV-29397 Fix note turning into error

ODBC Rewind triggered an error with no SQL, but this is sometimes a
valid condition (as can be seen with other classes). Setting this to a 0
return stops errors firing when they shouldn't.

Also fixes ASAN hits from in MDEV-29687 tabext.cpp.
2022-11-08 15:49:52 +00:00
Marko Mäkelä
2ac1edb1c3 Merge 10.5 into 10.6 2022-11-08 17:37:22 +02:00
Marko Mäkelä
e572c745dc MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY locking
ha_innobase::referenced_by_foreign_key(): Protect the check with
dict_sys.freeze(), to prevent races with TRUNCATE TABLE.
The test innodb.instant_alter_crash has been adjusted for this
additional locking.

dict_table_is_referenced_by_foreign_key(): Removed (merged to
the only caller).

create_table_info_t::create_table(): Ignore missing indexes for
FOREIGN KEY constraints if foreign_key_checks=0.

create_table_info_t::create_table_update_dict(): Rewritten as
a static function. Do not return any error.

ha_innobase::create(): When trx!=nullptr and we are operating
on a persistent table, do not rollback, commit, or release the
data dictionary latch.

ha_innobase::truncate(): Protect the entire critical section
with an exclusive dict_sys.latch, so that
ha_innobase::referenced_by_foreign_key() on referenced tables
will return a consistent result. In case of a failure,
invoke dict_load_foreigns() to restore also any FOREIGN KEY
constraints.

ha_innobase::free_foreign_key_create_info(): Define inline.

lock_release(): Disregard innodb_evict_tables_on_commit_debug=ON
when dict_sys.locked() holds. It would hold when fts_load_stopword()
is invoked by create_table_info_t::create_table_update_dict().

dict_sys_t::locked(): Return whether the current thread is holding
the exclusive dict_sys.latch.

dict_sys_t::frozen_not_locked(): Return whether any thread is
holding a shared dict_sys.latch.

In the test main.mysql_upgrade, the InnoDB persistent statistics
will no longer be recalculated in ha_innobase::open() as part of
CHECK TABLE ... FOR UPGRADE. They were deleted earlier in the test.

Tested by: Matthias Leich
2022-11-08 17:34:34 +02:00
Marko Mäkelä
a732d5e2ba Merge 10.4 into 10.5 2022-11-08 17:01:28 +02:00
Marko Mäkelä
8fb176c3c1 MDEV-27121 fixup: mariabackup.mdev-14447,full_crc32 2022-11-08 16:59:36 +02:00
Marko Mäkelä
12f20c154d Work around MDEV-24813 in main.rowid_filter_innodb_debug
Let us avoid excessive allocation of explicit record locks.
2022-11-08 16:04:16 +02:00
Marko Mäkelä
93b4f84ab2 Merge 10.3 into 10.4 2022-11-08 16:04:01 +02:00
Marko Mäkelä
2ef2e2322a MDEV-29856 heap-use-after-poison in row_merge_spatial_rows() w/ column prefix
spatial_index_info: Replaces index_tuple_info_t. Always take
a memory heap as a parameter to the member functions.
Remove pointer indirection for m_dtuple_vec.

spatial_index_info::add(): Duplicate any PRIMARY KEY fields that would
point to within ext->buf because that buffer will be allocated in
a shorter-lifetime memory heap.
2022-11-08 15:26:34 +02:00
Thirunarayanan Balathandayuthapani
f4519fb772 MDEV-28797 Assertion `page_rec_is_user_rec(rec)' failed in PageBulk::getSplitRec
- During alter operation of compressed table, page split operation
chooses the first record of the page as split record and it leads
to empty left page. This issue caused by the commit 77b3959b5c (MDEV-28457).

page_rec_is_second(), page_rec_is_second_last(): Removed the functions
since it is a deadcode.
2022-11-08 15:27:29 +05:30
Thirunarayanan Balathandayuthapani
db85d8b093 MDEV-29853 Assertion `!strstr(table->name.m_name, "/FTS_") || purge_sys.must_wait_FTS()' failed in trx_t::commit
- Failing debug assertion is to indicate whether the purge thread
is waiting when fts auxilary table is being dropped. But assertion
fails if the table name contains FTS_. So in fts_drop_table(), InnoDB
sets the auxilary table flag in transaction modified table list.
2022-11-08 15:27:29 +05:30
Thirunarayanan Balathandayuthapani
689e951227 MDEV-29518 ASAN Failure on i_s query when tablespace does rename operation
- InnoDB information schema query access the tablespace name after
getting freed by concurrent rename operation. To avoid this, InnoDB
should take exclusive tablespace latch during rename operation
and I_S query should take shared tablespace latch before accessing
the name
2022-11-08 15:27:29 +05:30
Marko Mäkelä
b737d09dbc MDEV-29905 Change buffer operations fail to check for log file overflow
Every operation that is going to write redo log is supposed to
invoke log_free_check() before acquiring any latches. If there
is a risk of log buffer overrun, a log checkpoint would be
triggered by that call.

ibuf_merge_space(), ibuf_merge_in_background(),
ibuf_delete_for_discarded_space(): Invoke log_free_check()
when the current thread is not holding any page latches.

Unfortunately, in lower-level code called from ibuf_insert()
or ibuf_merge_or_delete_for_page(), some page latches may be
held and a call to log_free_check() could hang.

ibuf_set_bitmap_for_bulk_load(): Use the caller's mini-transaction.
The caller should have invoked log_free_check() while not holding
any page latches.
2022-11-08 11:37:43 +02:00
Marko Mäkelä
49a0ad695b MDEV-23371: Crash in _db_doprnt_ via que_thr_step()
Something appears to be broken in the DBUG subsystem.
Let us remove frequent calls to it from the InnoDB internal SQL interpreter
that is used in the purge of transaction history.

The DBUG_PRINT in que_eval_sql() can remain for now, because those
operations are much less frequent.
2022-11-08 11:24:49 +02:00
Marko Mäkelä
1e8189fcee MDEV-13564 follow-up: Correct a bogus comment
This fixes up commit e3c39c0be8
2022-11-08 10:55:22 +02:00
Marko Mäkelä
9ac8be4e29 Include some advice in the crash-upgrade message 2022-11-08 10:39:29 +02:00
Marko Mäkelä
95e2595d8d MDEV-22512: Disable frequently failing tests
InnoDB crash recovery can run out of memory before
commit 50324ce624 in
MariaDB Server 10.5.

Let us disable some frequently failing recovery tests
in earlier versions.
2022-11-08 10:30:03 +02:00
Vladislav Vaintroub
e3a5a69524 MDEV-29822 - make mysqltest fail loudly when out of memory
When allocation failed, fail consistently with error message and abort()
by using flags MY_WME|MY_FAE with my_malloc() and friends.

This ensures that better diagnostic information is available
when mysqltest fails.
2022-11-08 08:02:18 +01:00
Marko Mäkelä
314ed9f5ec Work around MDEV-24813 in some tests
Not creating explicit record locks will speed up the test.

Also, disable the use of InnoDB persistent statistics in the test of
MDEV-27270 to avoid intermittent failures in 10.6 or later
(after commit 9608773f75)
due to the nondeterministic scheduling of STATS_AUTO_PERSISTENT.
2022-11-08 09:00:58 +02:00
Marko Mäkelä
456d4a508c Remove an unused file
The file plugin_exports became unused in
commit fec844aca8
2022-11-08 08:54:07 +02:00
Marko Mäkelä
eabb3b35d5 MDEV-27121 fixup: mariabackup.mdev-14447 fault injection 2022-11-08 08:53:49 +02:00
Oleksandr Byelkin
c4ce012e4b Merge branch '10.6' into bb-10.6-release 2022-11-07 16:33:00 +01:00
Oleksandr Byelkin
fe330b63fe Merge branch '10.5' into bb-10.5-release 2022-11-07 16:14:35 +01:00
Oleksandr Byelkin
e9dc39572f Merge branch '10.4' into bb-10.4-release 2022-11-07 15:49:14 +01:00
Daniel Bartholomew
118d39d3ee
bump the VERSION 2022-11-07 09:45:23 -05:00
Oleksandr Byelkin
01ac7455e2 Merge branch '10.3' into bb-10.3-release 2022-11-07 15:32:35 +01:00
Daniel Bartholomew
9201cda37c
bump the VERSION 2022-11-07 09:18:20 -05:00
Daniel Bartholomew
625fff0d8f
bump the VERSION 2022-11-07 08:35:15 -05:00
Daniel Bartholomew
baa6b052a2
bump the VERSION 2022-11-07 08:08:55 -05:00
Thirunarayanan Balathandayuthapani
f7e6198c02 MDEV-27121 mariabackup incompatible with disabled dedicated undo log tablespaces
- mariabackup fails to assign srv_undo_space_id_start when the
dedicated undo tablespaces are disabled
2022-11-07 17:36:08 +05:30
Sachin
10132ad261 MDEV-23264 Unique blobs allow duplicate values upon UPDATE
Problem:-
  We are able to insert duplicate value in table because cmp_binary_offset
  is not able to differentiate between NULL and empty string. So
  check_duplicate_long_entry_key is never called and we don't check for
  duplicate.
Solution
  Added a if condition with is_null() on field which can differentiate
  between NULL and empty string.
2022-11-07 09:50:59 +01:00
Vladislav Vaintroub
92be8d2048 MDEV-29951 server hang in crash handler
When trying to output stacktrace, and addr2line is not installed, the
child process forked by start_addr2line_fork() will fail to do exec(),
and finish with exit(1).

There is a problem with exit() though - it runs exit handlers,
and for the forked copy of crashing process, it is a bad idea.

In 10.5+ code for example, exit handlers include
tpool::task_group static destructors, and it will hang infinitely
waiting for completion of the outstanding tasks.

The fix is to use _exit() instead, which skips the execution of exit
handlers
2022-11-05 18:36:43 +01:00
Sergei Golubchik
d157b250ff update colunmstore 2022-11-03 11:20:33 +01:00
Ian Gilfillan
e7be2d3142 Fix duplicate entry in mysqld_safe man page 2022-11-03 12:25:38 +11:00
Oleksandr Byelkin
e5aa58190f Merge branch '10.5' into 10.6 2022-11-02 14:33:20 +01:00
Oleksandr Byelkin
177d858e38 Merge branch '10.4' into 10.5 2022-11-02 13:14:54 +01:00
Oleksandr Byelkin
0946c99e7d Merge branch '10.3' into 10.4 2022-11-02 13:13:45 +01:00
Oleksandr Byelkin
3303748fd1 MDEV-29926: ASAN heap-use-after-free in Explain_query::~Explain_query
Make sure that EXPLAIN object allocated on runtime arena.
2022-11-02 12:49:24 +01:00