Commit graph

195451 commits

Author SHA1 Message Date
Marko Mäkelä
97d82808b8 Fix clang -Wtypedef-redefinition
This fixes commit 77c184df7c.
2022-03-11 13:29:41 +02:00
Marko Mäkelä
9047a908fe Merge 10.4 into 10.5 2022-03-11 13:03:33 +02:00
Marko Mäkelä
fc8da65919 After-merge fix: clang -Winconsistent-missing-override
The virtual member function that was added in
commit 1766a18e06
needs to be declared "override".
2022-03-11 13:02:53 +02:00
Thirunarayanan Balathandayuthapani
2a4bba2743 MDEV-28030 row_discard_tablespace_for_mysql() can unlock data dictionary without locking data dictionary
- row_discard_tablespace_for_mysql() could unlock the data dictionary lock without locking it in the first place.
2022-03-11 14:39:25 +05:30
Thirunarayanan Balathandayuthapani
16c9eb5687 MDEV-27672 Assertion `!table->fts->in_queue' failed in fts_optimize_remove_table
- During rollback of InnoDB DDL, it un-necessary removes the table
from fts_optimize_wq. Removal of fts table from fts_optimize_wq when
it has only one fulltext and it is being rollbacked.
2022-03-11 14:39:25 +05:30
Marko Mäkelä
1596ef738c Merge 10.7 into 10.8 2022-03-11 10:49:49 +02:00
Marko Mäkelä
79bc654ac3 Merge 10.6 into 10.7 2022-03-11 10:48:58 +02:00
Marko Mäkelä
9b8d9a1db3 Fix main.create_or_replace
Ever since commit 9608773f75
we no longer disable innodb_stats_persistent.
Ever since commit 45a05fda27
updates of the InnoDB persistent statistics are covered by MDL.
2022-03-11 10:47:32 +02:00
Marko Mäkelä
be6f9593fe Merge 10.5 into 10.6 2022-03-11 09:53:40 +02:00
Marko Mäkelä
5503c40460 Stabilize innodb.redo_log_during_checkpoint
Externally kill and restart the server, and remove the
unreliable crash_after_checkpoint.
2022-03-11 09:46:50 +02:00
Marko Mäkelä
81523baac6 Merge 10.4 into 10.5 2022-03-11 09:36:03 +02:00
Marko Mäkelä
22d2df8c6b Merge 10.3 into 10.4 2022-03-11 09:26:42 +02:00
Daniel Black
fabaac86a1 MDEV-27956 hardware lock ellision on s390x/ppc64{,le}
Per https://gcc.gnu.org/onlinedocs/gcc/PowerPC-Hardware-Transactional-Memory-Built-in-Functions.html

The .. high level HTM interface .. is common between PowerPC and S/390

Reimplemented the transactional_lock_enabled() detection mechanism for
s390x and POWER based on SIGILL. This also gives non-Linux based unixes
the ability to use HTM. The implementation is based off openssl.
(ref:
1c0eede982/crypto/s390xcap.c (L104))

The other ppc64{,le} problems with getauxvec based detection:
* Checking PPC_FEATURE2_HTM_NOSC not needed as we do not do syscalls while
  in a transactional state.
* As we don't use, and never should use PPC_FEATURE2_HTM_NO_SUSPEND,
  or do syscalls while in transactional state, don't test it.
From: https://www.kernel.org/doc/html/v5.4/powerpc/syscall64-abi.html#transactional-memory

S390x high level __builtin_tbegin functions in the htmxlintrin.h are not
inline. This header file can be included once in the entire set of sources for
a linked target, otherwise duplicate symbols occur. While we could use inline
xabort/xend functions using the low level interface, we keep this the same as
ppc64 for simplicity.

SLES-15, gcc-7, appeared to want everything that included the htmlxlintrin to
be compiled with -mhtm otherwise the __builtin_t{func} where not defined
(in addition to a #ifdef __HTM__ #error). Debian sid gcc-11.2 wanted the same
on ppc64le/ppc64. In general we want to avoid a wide spread use of architecture
cflags as it makes justifications for selective optimizations easier.
(ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006702)
2022-03-11 10:42:27 +11:00
Marko Mäkelä
06ec439b8c MDEV-27058 fixup: Relax a debug assertion
buf_page_get_low(): Assert that the block not be read-fixed.
It may be write-fixed while we only hold a shared latch on the page.
Page writes are protected by U latches, which are compatible with S.
In all other places where we assert that the block not be IO-fixed,
we are holding U or X latch, which does prevent concurrent file I/O.
2022-03-10 15:23:28 +02:00
Marko Mäkelä
77c184df7c Explicitly specify that we use the C99 dialect 2022-03-10 15:08:39 +02:00
Vlad Lesin
1766a18e06 MDEV-19577 Replication does not work with innodb_autoinc_lock_mode=2
The first step for deprecating innodb_autoinc_lock_mode(see MDEV-27844) is:
- to switch statement binlog format to ROW if binlog format is MIXED and
the statement changes autoincremented fields
- issue warnings if innodb_autoinc_lock_mode == 2 and binlog format is
STATEMENT
2022-03-10 15:38:43 +03:00
Andrei
e7cf871dda MDEV-24617 OPTIMIZE on a sequence causes unexpected ER_BINLOG_UNSAFE_STATEMENT
The warning out of OPTIMIZE
  Statement is unsafe because it uses a system function
was indeed counterfactual and was resulted by checking an
insufficiently strict property of lex' sql_command_flags.

Fixed with deploying an additional checking of weather
the current sql command that modifes a share->non_determinstic_insert
table is capable of generating ROW format events.
The extra check rules out the unsafety to OPTIMIZE et al, while the
existing check continues to do so to CREATE TABLE (which is
perculiarly tagged as ROW-event generative sql command).

As a side effect sql_sequence.binlog test gets corrected and
binlog_stm_unsafe_warning.test is reinforced to add up
an unsafe CREATE..SELECT test.
2022-03-10 13:38:07 +02:00
Daniel Black
36a19f94ce MDEV-27936 hardware lock elision on ppc64{,le} failing to compile
Cannot have a function trx_has_lock_x hot and cold.
2022-03-10 18:47:57 +11:00
Daniel Black
6de482a6fe MDEV-28011: debian autobake cleanup
Travis is dead to us so we don't need all the conditions around it.

Remove depends for no longer supported versions

Debian Jessies, and Ubuntu Trusty, Xenial, Wily are all eol
as far as we are concerned.

The dependancy on an apt cache when running autobake broke the
10.2 aarch64 packages (MDEV-28014). Lets reduce the risk here.
2022-03-10 13:29:16 +11:00
Daniel Black
8ea08505a1 MDEV-28022: Debian stretch has zstd too old
zstd-1.1.3 is needed however stretch has only 1.1.2.

Move to distro version based checks as checks against the
apt-cache are unreliable if there is no cache.
2022-03-10 12:37:20 +11:00
Daniel Black
e8fc62b9d7 MDEV-27936 hardware lock elision on ppc64{,le} failing to compile
There is only a very small range of gcc compiler versions
that allow the built_{htm} functions to be defined without -mhtm
being specified as a global C{,XX}FLAGS.

Because the design is centered around enable HTM only in the
functional blocks that use it, this breaks on the inclusion
of the htmxlintrin.h header that includes this.

As a partial mitigation, extented to GNU/clang compilers,
transaction functions gain the attribute "hot".

In general the use of htm is around the optimistic
transaction ability of the function. The key part of using the
hot attribute is to place these functions together so that
a maximization of icache, tlb and OS paging can ensure that
these can be ready to execute by any thread/cpu with the
minimum amount of overhead.

POWER is particularly affected here because the xbegin/xend
functions are not inline.

srw_lock.cc requires the -mhtm cflag, both in the storage
engine and the unit tests.
2022-03-10 09:16:28 +11:00
Otto Kekäläinen
c61249eef1 Fix failing Gitlab-CI by fixing CentOS 8 repo urls 2022-03-09 11:57:16 +11:00
Otto Kekäläinen
ffb7f8854a Fix failing Gitlab-CI by adding pcre2-devel as a build dependency
The commits a73acf6c06 and
4d74bac8bc updated the PCRE library to a new
version, which in turn requires CMake 3.0. That does not exist in CentOS 7
nor 8, so builds started failing.

Actually the build should not be downloading anything at all. The root
cause was that pcre2-devel was missing from the dependencies. This was
originally not detected, as the download fallback had masked the issue.
2022-03-09 11:57:16 +11:00
Marko Mäkelä
e8a2a70cf8 Merge 10.7 into 10.8 2022-03-08 10:03:45 +02:00
Marko Mäkelä
af87186c1d Merge 10.6 into 10.7 2022-03-08 09:51:31 +02:00
Marko Mäkelä
fbef100530 Fix an uninitialized variable in debug builds 2022-03-08 09:04:48 +02:00
Marko Mäkelä
af345b72a9 MDEV-27891: Make the test work with debug builds 2022-03-08 09:04:24 +02:00
Marko Mäkelä
ed20e5b111 After-merge fixes 2022-03-08 09:04:03 +02:00
Haidong Ji
114476f2ec MDEV-27978 fix wrong name in error when max_session_mem_used exceeded
Fixed typo in my_malloc_size_cb_func. There is no max-thread-mem-used
sys variable in MariaDB, only max-session-mem-used. The relevant entry
in sys_vars.cc is also fixed.

Added a fallback case in case we could allocate the 256 bytes for the
error message containing the exact setting.
2022-03-08 15:13:09 +11:00
Vlad Lesin
202316a38f Merge 10.5 into 10.6 2022-03-07 18:42:47 +03:00
Vlad Lesin
0b92c7b0e0 Merge 10.4 into 10.5 2022-03-07 17:16:11 +03:00
Vlad Lesin
1ec3205703 Merge 10.3 into 10.4 2022-03-07 16:46:00 +03:00
Vlad Lesin
86c1bf118a MDEV-27992 DELETE fails to delete record after blocking is released
MDEV-27025 allows to insert records before the record on which DELETE is
locked, as a result the DELETE misses those records, what causes serious ACID
violation.

Revert MDEV-27025, MDEV-27550. The test which shows the scenario of ACID
violation is added.
2022-03-07 16:42:05 +03:00
Marko Mäkelä
2dce3bad9c Merge 10.4 into 10.5 2022-03-07 09:26:50 +02:00
Marko Mäkelä
7b97020d40 Merge 10.3 into 10.4 2022-03-07 09:05:36 +02:00
Daniel Black
b6a2472489 MDEV-27891: SIGSEGV in InnoDB buffer pool resize
During an increase in resize, the new curr_size got a value
less than old_size.

As n_chunks_new and n_chunks have a strong correlation to the
resizing operation in progress, we can use them and remove the
need for old_size.

For convienece the n_chunks_new < n_chunks is now the is_shrinking
function.

The volatile compiler optimization on n_chunks{,_new} is removed
as real mutex uses are needed.

Other n_chunks_new/n_chunks methods:

n_chunks_new and n_chunks almost always read and altered under
the pool mutex.

Exceptions are:
* i_s_innodb_buffer_page_fill,
* buf_pool_t::is_uncompressed (via is_blocked_field)
These need reexamining for the need of a mutex, however comments
indicates this already.

get_n_pages has uses in buffer pool load, recover log memory
exhaustion estimates and innodb status so take the minimum number
of chunks for safety.

The buf_pool_t::running_out function also uses curr_size/old_size.
We replace this hot function calculation with just n_chunks_new.
This is the new size of the chunks before the resizing occurs.

If we are resizing down, we've already got the case we had previously
(as the minimum). If we are resizing upwards, we are taking an
optimistic view that there will be buffer chunks available for locks.
As this memory allocation is occurring immediately next the resizing
function it seems likely.

Compiler hint UNIV_UNLIKELY removed to leave it to the branch
predictor to make an informed decision.

Added test case of a smaller size than the Marko/Roel original
in JIRA reducing the size to 256M. SEGV hits roughly 1/10 times
but its better than a 21G memory size.

Reviewer: Marko
2022-03-07 13:36:18 +11:00
Julius Goryavsky
5172f132bf galera_3nodes.galera_2_cluster: the test is temporarily disabled 2022-03-04 14:28:21 +01:00
Marko Mäkelä
02da00a98c Merge 10.2 into 10.3 2022-03-04 14:29:36 +02:00
Marko Mäkelä
3c06a0b7dc MDEV-28004 ha_innobase::reset_auto_increment() is never executed
The virtual member function handler::reset_auto_increment(ulonglong)
is only ever invoked by the default implementation of the virtual
member function handler::truncate().

Because ha_innobase::truncate() overrides handler::truncate() without
ever invoking handler::truncate(), some InnoDB member functions are
never called.

ha_innobase::innobase_reset_autoinc(), ha_innobase::reset_auto_increment():
Removed (unreachable code).

ha_innobase::delete_all_rows(): Removed. The default implementation
handler::delete_all_rows() works just as fine.
2022-03-04 14:23:33 +02:00
Thirunarayanan Balathandayuthapani
1248fe7277 MDEV-27582 Fulltext DDL decrements the FTS_DOC_ID value
- InnoDB FTS DDL decrements the FTS_DOC_ID when there is a
deleted marked record involved. FTS_DOC_ID must never be
reused. The purpose of FTS_DOC_ID is to be a unique row
identifier that will be changed whenever a fulltext indexed
column is updated.
2022-03-03 19:03:31 +05:30
Marko Mäkelä
a92f07f4bd MDEV-27993 Assertion failed in btr_page_reorganize_low()
btr_cur_optimistic_insert(): Disregard DEBUG_DBUG injection to
invoke btr_page_reorganize() if the page (and the table) is empty.
Otherwise, an assertion would fail in btr_page_reorganize_low()
because PAGE_MAX_TRX_ID is 0 in an empty secondary index leaf page.
2022-03-03 11:51:25 +02:00
Marko Mäkelä
c8a18589de Make main.desc_index_range more stable 2022-03-03 11:39:24 +02:00
Marko Mäkelä
dce8a846ae Merge 10.7 into 10.8 2022-03-03 11:34:58 +02:00
Marko Mäkelä
64ea3eab8f Merge 10.6 into 10.7 2022-03-03 11:11:00 +02:00
Rucha Deodhar
e8e755ea6c MDEV-26230: mysql_upgrade fails to load type_mysql_json due to insufficient
maturity level

Fix: Bumped maturity of the mysql_json plugin to gamma.
2022-03-03 12:37:07 +05:30
Otto Kekäläinen
1fa872f6ef Fix various spelling errors
Among others:
existance -> existence
reinitialze -> reinitialize
successfuly -> successfully
2022-03-03 13:42:49 +11:00
Marko Mäkelä
2db80c3773 MDEV-27973 SIGSEGV in ha_innobase::reset() after TRUNCATE of TEMPORARY TABLE
create_table_info_t::innobase_table_flags(): Ignore page_compressed
and page_compression_level on TEMPORARY tables.

ha_innobase::truncate(): Add a debug assertion that create() must succeed
on temporary tables.
2022-03-01 17:52:45 +02:00
Marko Mäkelä
d96433ad20 Merge 10.5 into 10.6 2022-03-01 17:40:27 +02:00
Sergei Petrunia
a1965b80e1 Make testcase for MDEV-26585 stable. 2022-03-01 17:19:58 +03:00
Nayuta Yanagisawa
0366fb5f54 MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values
When a partition with engine-defined partition options is added by
ALTER, it shows the correct definition in SHOW CREATE, but the actual
values get inherited from the previous partition.

The cause of the bug is that the server did not parse the options
associated with the newly added partition.

In the case of ALTER, the complete part_info, which represents the
partition structure after ALTER, is built by prep_alter_part_table().
So, we need to parse engine-defined partition options after the call
of the function.
2022-03-01 20:38:04 +09:00