Commit graph

191360 commits

Author SHA1 Message Date
Vladislav Vaintroub
08b0b70daa MDEV-24084 Fix race between disconnect and KILL CONNECTION
Prior to this patch, it is possible to access freed memory
(THD::event_scheduler) from tp_post_kill_notification().

With this patch, memory is freed only when THD is no more accessible
from other threads, i.e after it is removed from the thread_list.
2020-11-24 08:45:37 +01:00
Marko Mäkelä
dcdc8c3506 MDEV-21534 fixup: Remove HAVE_IB_LINUX_FUTEX
Since commit 30ea63b7d2
we actually depend on futex on Linux. Also, we depend on
std::atomic for even longer.
2020-11-23 15:45:03 +02:00
Alexey Botchkov
75e7132fca MDEV-21842 auto_increment does not increment with compound primary key on partitioned table.
The idea of this fix is that it's enough to prevent the
next_auto_inc_val from incrementing if an error, to fix this problem
and also the MDEV-17333.
So this patch basically reverts the existing fix to the MDEV-17333.
2020-11-23 14:12:30 +04:00
Sujatha
7effcb8ed6 MDEV-23846: O_TMPFILE error in mysqlbinlog stream output breaks restore
Problem:
========
When O_TMPFILE is not supported mysqlbinlog outputs the error to standard
stream as a warning which breaks PITR:

ERROR 1064 (42000) at line 382: You have an error in your SQL syntax; check
the manual that corresponds to your MariaDB server version for the right
syntax to use near 'mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling
    future attempts)

Analysis:
=========
'mysqlbinlog' utility is used to perform point-in-time-recovery based on binary
log. It converts the events in the binary log files, from binary format to text
so that they can be viewed or applied. This output can be saved to a file and
it can be sourced back to mysql client. The mysqlbinlog utility stores the
text output into IO_CACHE and when it is full the data is written to a temp
file.  The temporary file creation is attempted using 'O_TMPFILE' flag. If the
underlying filesystem doesn't support this operation, a note is printed on to
standard error and file creation is done without O_TMPFILE' flag. If standard
error is redirected to standard output the note gets written to the sql file
as shown below.

/bld/client/mysqlbinlog: O_TMPFILE is not supported on /tmp (disabling future
    attempts)
table id 32

When the sql file is used for PITR, it leads to a syntax error as it is not a
valid sql command.

Fix:
====
Make 'my_message_stderr' to ignore messages which are flagged as ME_NOTE and
ME_ERROR_LOG_ONLY. ME_ERROR_LOG_ONLY flag is applicable to server. In order to
print an informational note to stderr stream, ME_NOTE flag without
ME_ERROR_LOG_ONLY flag should be specified. 'my_message_stderr' should print
messages flagged with ME_WARNING or ME_FATAL to stderr stream.
2020-11-23 12:16:45 +05:30
sjaakola
fa6d710b85 MDEV-24097 node restart overlaps with earlier still ongoing SST process
In galera_3nodes.galera_safe_to_bootstrap node restart can happen too soon, when earlier SST joiner process is still active in the node.
Similar issue may hurt other mtr tests as well.

This is second variant of fix for this issue. Here we only change rsync SST script to wait a little bit if lingering SST rsync is observed to be in execution.
We assume that the previous mysqld and SST processes have been already signaled to abort during earlier stataup attempt.

If other SST methods (than rsync) suffer from similar overlapping SST execution, they should be sorted out separately within each SST method handler scripts.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-11-23 07:39:23 +02:00
Jan Lindström
fe56e0e342 MDEV-22136 : wsrep_restart_slave = 1 does not always work
Add test case
2020-11-23 07:39:23 +02:00
Marko Mäkelä
1e5d989d2a MDEV-24167: Remove PFS instrumentation of buf_block_t
We always defined PFS_SKIP_BUFFER_MUTEX_RWLOCK, that is,
the latches of the buffer pool blocks were never instrumented
in PERFORMANCE_SCHEMA.

For some reason, the debug_latch (which enforce proper usage of
buffer-fixing in debug builds) was instrumented.
2020-11-20 08:55:41 +02:00
Marko Mäkelä
156cb94b4b MDEV-22871 fixup: Relax a debug assertion
In commit bf3c862faa we introduced
an assertion that may dereference a null pointer.

This regression was caught by running the following:
./mtr --parallel=auto --suite=innodb \
--mysqld=--loose-innodb-adaptive-hash-index

The adaptive hash index is disabled by default since
commit 88cdfc5c7d (MDEV-20487)
and hence the problem was not caught earlier.
2020-11-20 08:49:46 +02:00
Marko Mäkelä
3c8ecb5bbd Run innodb_wl6326_big only in debug builds
The test seems to deterministically fail on RelWithDebInfo builds
due to a timeout in wait_condition.inc.

According to Matthias Leich (the original author of the test),
the failure rate would reduce if we disabled the purge of
transaction history by setting innodb_force_recovery=2.

For now, let us run this stress test on debug builds only.
2020-11-20 08:06:24 +02:00
Marko Mäkelä
8ac19be8a2 Cleanup: Fix build problems with the Intel compiler
fil_space_t::flush_low(): Define and declare without inline.

ut_is_2pow(): Remove UNIV_LIKELY. This is almost exclusively
used in debug assertions. UNIV_LIKELY is not compatible with
static_assert in some compilers.
2020-11-20 07:59:46 +02:00
Marko Mäkelä
9c455945f5 MDEV-21534 fixup: Use a compile-time constant 2020-11-20 07:59:41 +02:00
Igor Babaev
1248c654c4 MDEV-19179 Regression: SELECT ... UNION ... with inconsistent column names fails
A bogus error message was issued when a condition was pushed into a
materialized derived table or view specified as union of selects with
aggregation when the corresponding columns of the selects had different
names. This happened because the expression pushed into having clauses of
the selects was adjusted for the names of the first select of the union.
The easiest solution was to rename the columns of the other selects to be
name compatible with the columns of the first select.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2020-11-19 07:47:43 -08:00
Roman Nozdrin
a16e3c326d Update MCS to resolve libmarias3 compulation for centos74-amd64-debug
pipeline in community BB

Fix for rebuild from source step

Disable MCS on i386|i686 platforms

This patch puts MCS debian packaging files and part of debian/control
into the engine directory
2020-11-19 13:52:33 +00:00
Jan Lindström
031e1427ed MDEV-23659: Update Galera disabled.def file
Removed
* lp1376747-4
* MDEV-16509
* galera_defaults
2020-11-19 12:42:54 +02:00
Jan Lindström
6f50f51e60 MDEV-21494 : Galera test sporadic failure on galera.galera_defaults
Make sure that we operate with correct Galera library version
and do not print wsrep_provider_options field.
2020-11-19 12:42:54 +02:00
Daniele Sciascia
60035bd2f1 Make test galera_parallel_apply_3nodes deterministic
Test galera_parallel_apply_3nodes started to failed occasionally.
The test assumes that one round of autocommit retry is sufficient in
order to avoid a deadlock error when two conflicting UPDATE statements
run concurrently.
This assumption no longer holds after galera library has changed
last_committed() to return the seqno of the last transaction that left
apply monitor, rather than commit monitor. So it is possible that
after a BF abort, a command is re-executed before it's BF abortee has
left the apply monitor. Thus causing another retry or a deadlock error.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2020-11-19 12:42:54 +02:00
Jan Lindström
3897ce2396 MDEV-21523 : galera.MDEV-16509 MTR failed: timeout after 900 seconds: Can't connect to local MySQL server
Add requirement for debug-build.
2020-11-19 12:42:54 +02:00
Jan Lindström
b04be43ead MDEV-24165 : Galera test failure on galera_var_ignore_apply_errors
Add wait conditions.
2020-11-19 12:42:54 +02:00
Daniel Black
3b486c28f7 MDEV-24125: linux large pages, linux/mman.h needed
Centos/RHEL7 have the MAP_HUGE_SHIFT constant
defined in linux/mman.h which needed to get included.
2020-11-19 16:30:17 +11:00
Rasmus Johansson
bbbab8215f MDEV-24100 Failed to read test report file: Invalid byte 2 of 3-byte UTF-8 sequence.
Explicitly setting encoding to UTF-8 when writing to file and
replacing wide characters from MTR_RES_FAILED when writing to
XML file. The wide characters are not allowed in XML.
2020-11-18 12:31:41 +00:00
Marko Mäkelä
ce0cb6a4f6 MDEV-24188 fixup: Correct the FindBlockX predicate
FindBlockX::operator(): Return false if an x-latched block is found.
Previously, we were incorrectly returning false if the block was in
the log, only if not x-latched.

It is unknown if this mistake had any visible impact. Often,
we would register both MTR_MEMO_BUF_FIX and MTR_MEMO_PAGE_X_FIX
for the same block.
2020-11-18 13:52:37 +02:00
Marko Mäkelä
33d41167c5 MDEV-24224 Gap lock on delete in 10.5 using READ COMMITTED
When MDEV-19544 (commit 1a6f470464)
simplified the initialization of the local variable
set_also_gap_locks, an inadvertent change was included.
Essentially, all code branches that are executed when
set_also_gap_locks hold must also ensure that
trx->isolation_level > TRX_ISO_READ_COMMITTED holds.
This was being violated in a few code paths.

It turns out that there is an even simpler fix: Remove the test
of thd_is_select() completely. In that way, the first part of
UPDATE or DELETE should work exactly like SELECT...FOR UPDATE.

thd_is_select(): Remove.
2020-11-18 10:27:18 +02:00
Igor Babaev
6628435e94 MDEV-24220 Server crash in base_list_iterator::next or
in TABLE_LIST::is_recursive_with_tables

After the patch for MDEV-23619 the code of st_select_lex::cleanup started
using the list st_select_lex::leaf_tables. This list is built for any
query with FROM clause in the function setup_tables(). If such query is
used in a stored procedure it must be ensured that the list is empty
before each new call of the procedure. Otherwise if the first call of
the procedure is successful while the second call reports an error before
the setup_tables() is invoked then list st_select_lex::leaf_tables would
point to a piece of memory that has been already freed.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2020-11-17 14:29:53 -08:00
Marko Mäkelä
fabdad6857 Merge 10.4 into 10.5 2020-11-17 18:15:13 +02:00
Marko Mäkelä
bbf0b55c17 Work around MDEV-24232: Skip perfschema.nesting if WITH_WSREP=OFF 2020-11-17 18:13:47 +02:00
Marko Mäkelä
83a55670a6 MDEV-24188 fixup: Simplify the wait loop
Starting with commit 7cffb5f6e8 (MDEV-23399)
the function buf_flush_page() will first acquire block->lock and only
after that invoke set_io_fix(). Before that, it was possible to reach
a livelock between buf_page_create() and buf_flush_page().

buf_page_create(): Directly try acquiring the exclusive page latch
without checking whether the page is io-fixed or buffer-fixed.
(As a matter of fact, the have_x_latch() check is not strictly necessary,
because we still support recursive X-latches.)
In case of a latch conflict, wait while allowing buf_page_write_complete()
to acquire buf_pool.mutex and release the block->lock.

An attempt to wait for exclusive block->lock while holding buf_pool.mutex
would lead to a hang in the tests parts.part_supported_sql_func_innodb
and stress.ddl_innodb, due to a deadlock between buf_page_write_complete()
and buf_page_create().

Similarly, in case of an I/O fixed compressed-only
ROW_FORMAT=COMPRESSED page, we will sleep before retrying.

In both cases, we will sleep for 1ms or until a flush batch is completed.
2020-11-17 17:56:50 +02:00
Sergei Petrunia
ceef26cf86 MyRocks: Bare Windows compatibility: use rmdir built-in, not "rm -rf" 2020-11-17 15:49:36 +03:00
Dmitry Shulga
796f708f85 MDEV-24115 Fix -Wconversion in Timeval::Timeval() on Mac OS X
The data member tv_usec of the struct timeval is declared as suseconds_t
on MacOS. Size of suseconds_t is 4 bytes. On the other hand, size of ulong
is 8 bytes on 64-bit MacOS, so attempt to assign a value of wider type
(usec) to a value (tv_usec) of narrower type leads to error.
2020-11-17 19:23:33 +07:00
Marko Mäkelä
f0c9903795 Merge 10.3 into 10.4 2020-11-17 13:56:20 +02:00
Daniele Sciascia
694926a4f7 Fix suppression in MTR test galera_3nodes.inconsistency_shutdown 2020-11-17 13:00:44 +02:00
Sujatha
c815ffb975 MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
Post push fix. Update version to 10.5.8.
2020-11-17 16:08:32 +05:30
Jan Lindström
ab4f743610 MDEV-24169 : Galera test failure on galera_rsu_simple
Add wait_condition.
2020-11-17 08:52:47 +02:00
Jan Lindström
bca683e895 MDEV-24166 : Galera test failure on galera_toi_alter_auto_increment
Add primary key and wait condition.
2020-11-17 08:51:04 +02:00
Jan Lindström
0bde52e6a8 MDEV-24164 : Galera test failure on galera_fk_cascade_delete
Add wait_conditions.
2020-11-17 08:36:38 +02:00
Daniel Black
7f30a5c423 MDEV-24125: allow compile on Linux headers < 3.8
This allows MariaDB to compile on old (limits to >2.6.32)
linux kernel versions.

This warns that attempts to use large pages will rely on
implict kernel determination.
2020-11-17 07:53:55 +11:00
Daniel Black
8cc5d2845c MDEV-24125: linux large pages - Revert "Fixed centos 6 build failure"
This reverts commit 6cf8f05fd9.

Original patch assumed that MAP_HUGETLB as consistent across
achitectures which isn't the case. Defining it unconditionally
broke large pages on every achitecutre where the value differed
from x86_64.

With the EOL for Centos/RHEL6 announced in 10.5.7, <3.8 linux
kernels are no longer supported.
2020-11-17 07:53:55 +11:00
Daniel Black
0fc0eb1e5b MDEV-24124: main.drop test - mulitarch/os error messages
Account for variety of mips, hppa, solaris and other messages.

Copied from rpl.rpl_drop_db test.
2020-11-17 07:41:57 +11:00
Monty
eae9311fa2 Do not run maria.repair with --embedded as memory usage is different 2020-11-16 13:23:39 +02:00
Daniele Sciascia
1ae7809a7c Restore autoincrement offset in MTR test MDEV-24063 2020-11-16 12:32:08 +02:00
Sujatha
2b347e9fc5 MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
Fixing a post push test issue.
2020-11-16 14:49:46 +05:30
Sujatha
6da68049b5 MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
Add a new privilege "SLAVE MONITOR" which will grant user the permission
to execute "SHOW SLAVE STATUS" and "SHOW RELAYLOG EVENTS" commands.

SHOW SLAVE STATUS requires either SLAVE MONITOR/SUPER
SHOW RELAYLOG EVENTS requires SLAVE MONITOR privilege.
2020-11-16 14:31:44 +05:30
Daniel Black
9b30212f15 MDEV-24161: shortcut OQGRAPH dependency checks if disabled
Reviewer: Brad Smith
2020-11-16 09:47:19 +11:00
Roman Nozdrin
1edd224372 This patch puts MCS debian packaging files and part of debian/control
into the engine directory
2020-11-14 19:09:34 +00:00
Oleksandr Byelkin
81b9c78500 MDEV-24098: 10.5 followup
remove version data from the test output
2020-11-14 12:28:28 +01:00
Oleksandr Byelkin
6daf6bbcfe Merge branch '10.4' into 10.5 2020-11-14 10:15:54 +01:00
Oleksandr Byelkin
1bebc8de5d Merge branch '10.3' into 10.4 2020-11-14 10:05:23 +01:00
Oleksandr Byelkin
a00e21c03d Merge branch '10.2' into 10.3 2020-11-14 09:57:22 +01:00
Oleksandr Byelkin
c8be6aafb9 Fix to make it compiling on new ubuntu. 2020-11-14 09:55:09 +01:00
Marko Mäkelä
e8f8992801 MDEV-24188: Merge 10.4 into 10.5 2020-11-13 22:06:50 +02:00
Marko Mäkelä
ca331bdcda MDEV-23619: Merge 10.4 into 10.5 2020-11-13 22:06:05 +02:00