Commit graph

13737 commits

Author SHA1 Message Date
Jan Lindström
a3eddd9f11 MDEV-23659 : Update Galera disabled.def file
Changes to be committed:
	modified:   mysql-test/suite/galera/disabled.def
	modified:   mysql-test/suite/wsrep/disabled.def
2020-10-10 08:50:50 +03:00
Jan Lindström
fc3b5c7db3 MDEV-17585 : wsrep.variables failed in buildbot with deadlock on CREATE USER
Stabilize test by using correct galera library and restore
original galera cluster at end.
2020-10-10 08:50:50 +03:00
Jan Lindström
266bf77bc7 MDEV-19968 : Galera test failure on galera_load_data
Add necessary wait_conditions to stabilize test.
2020-10-10 08:50:50 +03:00
Thirunarayanan Balathandayuthapani
6504d3d229 MDEV-23722 InnoDB: Assertion: result != FTS_INVALID in fts_trx_row_get_new_state
Marking of deletion of row in fts index happens twice in
self-referential foreign key relation. So while performing
referential checks of foreign key, InnoDB can avoid updating
of fts index if the foreign key has self-referential relationship.

Reviewed-by: Marko Mäkelä
2020-10-08 19:41:03 +05:30
Daniel Black
874942a0f9 MDEV-4851: (tests) log tables modifiable on log_output!=TABLE
Test we can ALTER log tables directly when not being written
to.

This removes the contraint in the rpl_mysql_upgrade.test such
that we can run mysql_upgrade --write-binlog all the way
through to a replica. We test this in the replication scenario
where the mysql.{slow,general}_log tables aren't being
written to.

Reviewers: Vicențiu Ciorbaru, Anel Husakovic
2020-10-08 07:41:55 +11:00
Andrei Elkin
65c632cb9c MDEV-23832 Crash at startup in Log_event::read_log_event
The crash was caused by improper raising of an error or replication checksum
verification at time of the server initialization. As there is no THD object
associated with the main initializing thread yet the error text should be
assigned with calling a respective macro that is aware of that possibility.

Fixed accordingly.

[At merging to 10.4 the new test result file needs
 +# restart: --master_verify_checksum=ON --debug_dbug=+d,corrupt_read_log_event_char
that mtr run will hint on.]
2020-10-07 12:09:00 +03:00
Marko Mäkelä
1595189250 MDEV-23897 SIGSEGV on commit with innodb_lock_schedule_algorithm=VATS
This regression for debug builds was introduced by
MDEV-23101 (commit 224c950462).

Due to MDEV-16664, the parameter
innodb_lock_schedule_algorithm=VATS
is not enabled by default.

The purpose of the added assertions was to enforce the invariant that
Galera replication cannot be enabled together with VATS due to MDEV-12837.
However, upon closer inspection, it is obvious that the variable 'lock'
may be assigned to the null pointer if no match is found in the
previous->hash list.

lock_grant_and_move_on_page(), lock_grant_and_move_on_rec():
Assert !lock->trx->is_wsrep() only after ensuring that lock
is not a null pointer.
2020-10-06 22:35:43 +03:00
Aleksey Midenkov
2b832151ad MDEV-23787 mtr --rr fixes
1. rr record -h randomizes number of processors. Disable THREAD_POOL_SIZE check.

2. check for kernel.perf_event_paranoid for user-friendly error message.
2020-10-06 15:07:06 +03:00
Jan Lindström
33f19876a2 MDEV-18593 : galera.galera_gcache_recover_full_gcache: Test failure: galera_gcache_recover_full_gcache.test: assert_grep.inc failed
Grep only the fact that we need to fall back to SST.
2020-10-06 12:03:13 +03:00
Jan Lindström
0aef658dfa Remove unnecessary and incorrect add_suppression.
Changes to be committed:
	modified:   mysql-test/suite/sys_vars/r/wsrep_cluster_address_basic.result
	modified:   mysql-test/suite/sys_vars/t/wsrep_cluster_address_basic.test
2020-10-05 10:34:01 +03:00
Marko Mäkelä
295e2d500b MDEV-16664: Add deprecation warning for innodb_lock_schedule_algorithm=VATS
The setting innodb_lock_schedule_algorithm=VATS that was introduced
in MDEV-11039 (commit 021212b525)
causes conflicting exclusive locks to be incorrectly granted to
two transactions. Specifically, in lock_rec_insert_by_trx_age()
the predicate !lock_rec_has_to_wait_in_queue(in_lock) would hold even
though an active transaction is already holding an exclusive lock.
This was observed between two DELETE of the same clustered index record.
The HASH_DELETE invocation in lock_rec_enqueue_waiting() may be related.

Due to lack of progress in diagnosing the problem, we will deprecate the
option and issue a warning that using it may corrupt data. The unsafe
option was enabled between
commit 0c15d1a6ff (MariaDB 10.2.3)
and the parent of
commit 1cc1d0429d (MariaDB 10.2.17, 10.3.9).
2020-10-05 09:34:27 +03:00
Daniel Black
904b811636 mtr: innodb_stats_dropped_locked cleanup
As discovered in later test, this test doesn't remove
the innodb_{index,table}_stats entries generated
in the test upon completion.
2020-10-01 16:10:14 +10:00
Marko Mäkelä
323500bfa9 Merge 10.2 into 10.3 2020-09-30 16:25:06 +03:00
Marko Mäkelä
a441b06489 Merge 10.1 into 10.2 2020-09-29 10:04:37 +03:00
Sujatha
6cbbd6bd96 Merge branch '10.2' into 10.3 2020-09-28 17:27:42 +05:30
Jan Lindström
842616532a MDEV-23659 : Update Galera disabled.def file
Fix typo.
2020-09-28 14:40:00 +03:00
Thirunarayanan Balathandayuthapani
fdb3c64e42 MDEV-22277 LeakSanitizer: detected memory leaks in mem_heap_create_block_func after attempt to create foreign key
- During online DDL, prepare phase error handler fails to remove
the memory allocated for newly created foreign keys.
2020-09-28 17:04:02 +05:30
Sujatha
3a5e719e00 Merge branch '10.1' into 10.2 2020-09-28 14:03:46 +05:30
Jan Lindström
c078f55f47 MDEV-23659 : Update Galera disabled.def file
This will update galera_3nodes/disabled.def.
2020-09-28 11:05:09 +03:00
Vladislav Vaintroub
a6987d9fb9 MDEV-23823 Crash in SELECT NEXT VALUE on locked view
Make open_table() fail if sequence should be opened, but it turns out to
be locked view.
2020-09-28 09:49:46 +02:00
Sujatha
15cd919535 MDEV-22330: mysqlbinlog stops with an error Don't know how to handle column type: 255 meta: 4 (0004)
Analysis:
========
"mysqlbinlog -v" option will reconstruct row events and display them as
commented SQL statements. If this option is given twice, the output includes
comments to indicate column data types and some metadata.
`log_event_print_value` is the function reponsible for printing values and
their types. This function doesn't handle GEOMETRY type. Hence the above error
gets printed.

Fix:
===
Add support for GEOMETRY datatype.
2020-09-28 12:52:09 +05:30
Daniel Black
1be8ac390d Revert "[MDEV-7978] add show create user"
Appoligies, had a dirty branch before pushing:

This reverts commit 053653a23c.

This reverts commit 0ff897807f.

This reverts commit 85b085972b.

This reverts commit f3f45e46b6.

This reverts commit a470b3570a.

This reverts commit f8b8d202bc.

This reverts commit 6b6f066fdd.

This reverts commit a701e9e6c3.

This reverts commit c169838611.
2020-09-24 13:58:29 +10:00
Marko Mäkelä
d9d9c30b70 Merge 10.2 into 10.3 2020-09-22 21:12:48 +03:00
Marko Mäkelä
9d0ee2dcb7 Merge 10.1 into 10.2 2020-09-22 15:21:43 +03:00
Marko Mäkelä
fde3d895d9 Merge 10.2 into 10.3 2020-09-22 14:33:03 +03:00
Marko Mäkelä
3eb81136e1 MDEV-22939 Server crashes in row_make_new_pathname()
The statement ALTER TABLE...DISCARD TABLESPACE is problematic,
because its designed purpose is to break the referential integrity
of the data dictionary and make a table point to nowhere.

ha_innobase::commit_inplace_alter_table(): Check whether the
table has been discarded. (This is a bit late to check it, right
before committing the change.) Previously, we performed this check
only in a specific branch of the function commit_set_autoinc().

Note: We intentionally allow non-rebuilding ALTER TABLE even if
the tablespace has been discarded, to remain compatible with MySQL.
(See the various tests with "wl5522" in the name, such as
innodb.innodb-wl5522.)

The test case would crash starting with 10.3 only, but it does not hurt
to minimize the code and test difference between 10.2 and 10.3.
2020-09-22 13:40:05 +03:00
Marko Mäkelä
2af8f712de MDEV-23776: Re-apply the fix and make the test more robust
The test that was added in commit e05650e686
would break a subsequent run of a test encryption.innodb-bad-key-change
because some pages in the system tablespace would be encrypted with
a different key.

The failure was repeatable with the following invocation:

./mtr --no-reorder \
encryption.create_or_replace,cbc \
encryption.innodb-bad-key-change,cbc

Because the crash was unrelated to the code changes that we reverted
in commit eb38b1f703
we can safely re-apply those fixes.
2020-09-22 13:08:09 +03:00
Marko Mäkelä
732cd7fd53 MDEV-23705 Assertion 'table->data_dir_path || !space'
After DISCARD TABLESPACE, the tablespace of a table will no longer
exist, and dict_get_and_save_data_dir_path() would invoke
dict_get_first_path() to read an entry from SYS_DATAFILES.
For some reason, DISCARD TABLESPACE would not to remove the entry
from there.

dict_get_and_save_data_dir_path(): If the tablespace has been
discarded, do not bother trying to read the name.

Side note: The tables SYS_TABLESPACES and SYS_DATAFILES are
redundant and subject to removal in MDEV-22343.
2020-09-22 11:13:51 +03:00
Marko Mäkelä
2cf489d430 Merge 10.2 into 10.3 2020-09-21 16:39:23 +03:00
Marko Mäkelä
e05650e686 MDEV-23776: Add the reduced encryption.create_or_replace test
This was forgotten in commit a9d8f5c1a5.
2020-09-21 16:35:28 +03:00
Marko Mäkelä
a9d8f5c1a5 MDEV-23776: Split encryption.create_or_replace
Let us shrink the test encryption.create_or_replace so that it can
run on the CI system, also on the embedded server.

encryption.create_or_replace_big: Renamed from the original test,
with the subset of encryption.create_or_replace omitted.
2020-09-21 16:14:35 +03:00
Jan Lindström
a3bdce8f1e MDEV-23659 : Update Galera disabled.def file 2020-09-21 14:01:56 +03:00
Jan Lindström
a0e2a293bc Fix try. 2020-09-21 13:59:13 +03:00
Vlad Lesin
0a224edc3e MDEV-23711 make mariabackup innodb redo log read error message more clear
log_group_read_log_seg() returns error when:

1) Calculated log block number does not correspond to read log block
number. This can be caused by:
  a) Garbage or an incompletely written log block. We can exclude this
  case by checking log block checksum if it's enabled(see innodb-log-checksums,
  encrypted log block contains checksum always).
  b) The log block is overwritten. In this case checksum will be correct and
  read log block number will be greater then requested one.

2) When log block length is wrong. In this case recv_sys->found_corrupt_log
is set.

3) When redo log block checksum is wrong. In this case innodb code
writes messages to error log with the following prefix: "Invalid log
block checksum."

The fix processes all the cases above.
2020-09-21 12:29:52 +03:00
Marko Mäkelä
cbcb4ecabb Merge 10.2 into 10.3 2020-09-21 11:04:04 +03:00
Vicențiu Ciorbaru
053653a23c [MDEV-7978] Update test cases for sysvars_server_embedded. 2020-09-20 16:10:02 +10:00
Vicențiu Ciorbaru
a470b3570a [MDEV-7978] Update test cases
Update test to account for the new SHOW CREATE USER command.
2020-09-20 16:10:00 +10:00
Vicențiu Ciorbaru
6b6f066fdd [MDEV-7978] Update test cases
Adding an extra statement requires test cases update.
2020-09-20 16:08:40 +10:00
Jan Lindström
69d536a22d MDEV-23751 : galera_3nodes test failures on ipv6 sst tests
Fix assertion text it was too tight for some systems.

This is backport from 10.4 and for Galera 3.
2020-09-18 14:09:24 +03:00
Jan Lindström
f381e019b6 MDEV-23574 : galera_3nodes.galera_ipv6_mariabackup_section MTR failed: Could not open '../galera/include/have_mariabackup.inc'
Test case and configuration cleanup.
2020-09-17 12:55:06 +03:00
Jan Lindström
e3e657373a MDEV-21769 : galera_3nodes.galera_safe_to_bootstrap fails
Add wait_condition to wait correct cluster configuration.
2020-09-17 08:25:07 +03:00
Jan Lindström
96426dac91 MDEV-21655 : galera.galera_wan_restart_ist MTR fails sporadically: WSREP did not transition to state READY
Replace sleeps with proper wait_conditions to wait correct
cluster configuration.
2020-09-16 15:23:41 +03:00
Sujatha
873cc1e77a MDEV-21839: Handle crazy offset to SHOW BINLOG EVENTS
Problem:
=======
SHOW BINLOG EVENTS FROM <"random"-pos> caused a variety of failures as
reported in MDEV-18046. They are fixed but that approach is not future-proof
as well as is not optimal to create extra check for being constructed event
parameters.

Analysis:
=========
"show binlog events from <pos>" code considers the user given position as a
valid event start position. The code starts reading data from this event start
position onwards and tries to map it to a set of known events. Each event has
a specific event structure and asserts have been added to ensure that, read
event data, satisfies the event specific requirements. When a random position
is supplied to "show binlog events command" the event structure specific
checks will fail and they result in assert.

For example: https://jira.mariadb.org/browse/MDEV-18046
In the bug description user executes CREATE TABLE/INSERT and ALTER SQL
commands.

When a crazy offset like "SHOW BINLOG EVENTS FROM 365" is provided code
assumes offset 365 as valid event begin and proceeds to EVENT_LEN_OFFSET reads
some random length and comes up with a crazy event which didn't exits in the
binary log. In this quoted example scenario, event read at offset 365 is
considered as "Update_rows_log_event", which is not present in binary log.
Since this is a random event its validation fails and code results in
assert/segmentation fault, as shown below.

mysqld: /data/src/10.4/sql/log_event.cc:10863: Rows_log_event::Rows_log_event(
    const char*, uint, const Format_description_log_event*):
    Assertion `var_header_len >= 2' failed.
    181220 15:27:02 [ERROR] mysqld got signal 6 ;
#7  0x00007fa0d96abee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055e744ef82de in Rows_log_event::Rows_log_event (this=0x7fa05800d390,
    buf=0x7fa05800d080 "", event_len=254, description_event=0x7fa058006d60) at
/data/src/10.4/sql/log_event.cc:10863
#9  0x000055e744f00cf8 in Update_rows_log_event::Update_rows_log_event

Since we are reading random data repeating the same command SHOW BINLOG EVENTS
FROM 365 produces different types of crashes with different events. MDEV-18046
reported 10 such crashes.

In order to avoid such scenarios user provided starting offset needs to be
validated for its correctness. Best way of doing this is to make use of
checksums if they are available. MDEV-18046 fix introduced the checksum based
validation.

The issue still remains in cases where binlog checksums are disabled. Please
find the following bug reports.

MDEV-22473: binlog.binlog_show_binlog_event_random_pos failed in buildbot,
            server crashed in read_log_event
MDEV-22455: Server crashes in Table_map_log_event,
            binlog.binlog_invalid_read_in_rotate failed in buildbot

Fix:
====
When binlog checksum is disabled, perform scan(via reading event by event), to
validate the requested FROM <pos> offset. Starting from offset 4 read the
event_length of next_event in the binary log. Using the next_event length
advance current offset to point to next event. Repeat this process till the
current offset is less than or equal to crazy offset. If current offset is
higher than crazy offset provide appropriate invalid input offset error.
2020-09-16 14:03:32 +05:30
Vlad Lesin
80075ba011 MDEV-19264 Better support MariaDB GTID for Mariabackup's --slave-info option
Parse SHOW SLAVE STATUS output for the "Using_Gtid" column. If the value
is "No", then old log file and position is backed up, otherwise gtid_slave_pos
is backed up.
2020-09-14 11:14:50 +03:00
Nikita Malyavin
ae8ff3a067 MDEV-20396 Server crashes after DELETE with SEL NULL Foreign key and a
virtual column in index

Problem:
row_ins_foreign_fill_virtual was unconditionally set virtual fields to NULL
even though the field is not a part of a foreign key
(but a part of an index)

Solution:
The new virtual value should be computed with regard to cascade updates.
2020-09-14 18:08:56 +10:00
Sachin
c3a3b4596c MDEV-17438 rpl.show_status_stop_slave_race-7126 fails with timeout on Windows
Problem:- Test case uses socket which does not work on windows, So mysqlslap
falls back to default connection which is defined in my.cnf and connects
to master instead of slave. Since start slave/stop slave is executed on
master we get error MASTER_HOST was not set

Solution:- Use Port instead of socket
2020-09-11 15:35:32 +01:00
Jan Lindström
bc2dbdb601 MDEV-23587 : galera_3nodes.galera_var_dirty_reads2 MTR failed: 1047: WSREP has not yet prepared node for application use
Add wait_condition tomake sure insert is replicated and server
is after isolation back on ready state.
2020-09-11 14:49:42 +03:00
Thirunarayanan Balathandayuthapani
75e82f71f1 MDEV-18867 Long Time to Stop and Start
fts_drop_orphaned_tables() takes long time to remove the orphaned
FTS tables. In order to reduce the time, do the following:

- Traverse fil_system.space_list and construct a set of
table_id,index_id of all FTS_*.ibd tablespaces.
- Traverse the sys_indexes table and ignore the entry
from the above collection if it exist.
- Existing elements in the collection can be considered as
orphaned fts tables. construct the table name from
(table_id,index_id) and invoke fts_drop_tables().
- Removed DICT_TF2_FTS_AUX_HEX_NAME flag usage from upgrade.
- is_aux_table() in dict_table_t to check whether the given name
is fts auxiliary table
fts_space_set_t is a structure to store set of parent table id
and index id
- Remove unused FTS function in fts0fts.cc
- Remove the fulltext index in row_format_redundant test case.
Because it deals with the condition that SYS_TABLES does have
corrupted entry and valid entry exist in SYS_INDEXES.
2020-09-10 14:10:26 +05:30
Jan Lindström
5c07ce406b MDEV-23706 : Galera test failure on galera_autoinc_sst_mariabackup
Remove infinite procedure and use direct INSERTs.
2020-09-09 16:03:15 +03:00
Marko Mäkelä
7e07e38cf6 Merge 10.2 into 10.3 2020-09-09 13:06:46 +03:00