Commit graph

186100 commits

Author SHA1 Message Date
Sergei Petrunia
d4edb0510e MDEV-20646: 10.3.18 is slower than 10.3.17
Fix incorrect change introduced in the fix for MDEV-20109.

The patch tried to compute a more precise estimate for the record_count
value in SJ-Materialization-Scan strategy (in
Sj_materialization_picker::check_qep).  However the new formula is worse
as it produces extremely optimistic results in common cases where
SJ-Materialization-Scan should be used)

The old formula produces pessimistic results in cases when Sj-Materialization-
Scan is unlikely to be a good choice anyway. So, the old behavior is better.
2019-11-13 18:53:59 +03:00
Marko Mäkelä
5098d708a0 Merge 10.2 into 10.3 2019-11-12 16:42:58 +02:00
Marko Mäkelä
2570cb8b91 MDEV-12353 preparation: Clean up mtr_t
mtr_t::Impl, mtr_t::Command: Merge to mtr_t.

MTR_MAGIC_N: Remove.

MTR_STATE_COMMITTING: Remove. This state was only being set
internally during mtr_t::commit().

mtr_t::Command::m_locks_released: Remove (set-and-never-read member).

mtr_t::Command::m_start_lsn: Replaced with the return value of
finish_write() and a parameter to release_blocks().

mtr_t::Command::m_end_lsn: Removed as a duplicate of mtr_t::m_commit_lsn.

mtr_t::Command::prepare_write(): Replace a switch () with a
comparison against 0. Only 2 m_log_mode are allowed.
2019-11-12 15:46:57 +02:00
Marko Mäkelä
dc8380b65d MDEV-14602: Cleanup recv_dblwr_t::find_page()
Avoid creating std::vector, and use single instead of double traversal.
2019-11-12 14:41:24 +02:00
Marko Mäkelä
2350066e63 Merge 10.1 into 10.2 2019-11-12 14:36:37 +02:00
Sujatha
7df07c7666 MDEV-20953: binlog_encryption.rpl_corruption failed in buildbot due to wrong error code
Problem:
========
CURRENT_TEST: binlog_encryption.rpl_corruption

mysqltest: In included file "./include/wait_for_slave_io_error.inc":
...
At line 72: Slave stopped with wrong error code
**** Slave stopped with wrong error code: 1743 (expected 1595,1913) ****

Analysis:
========
The test emulates the corruption at the various stages of replication for
example in binlog file, in network and in relay log etc. It verifies that all
corruption cases are handled through appropriate error messages.

The test cases which emulate network failure expect following errors.
--ER_SLAVE_RELAY_LOG_WRITE_FAILURE (1595)
--ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE (1743)

Ideally test should expect error codes as 1595 and 1743.
But the test actually waits on incorrect error code 1595,1913

Fix:
===
Added appropriate error code for 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE'.
Replaced 1913 with 1743.
2019-11-12 16:31:08 +05:30
Andrei Elkin
40e65e878e rpl_semi_sync_gtid_reconnect results merge 2019-11-11 21:12:14 +02:00
Andrei Elkin
d103c5a489 merge 10.2->10.3 with conflict resolutions 2019-11-11 16:28:21 +02:00
Andrei Elkin
26fd880d5e manual merge 10.1->10.2 2019-11-11 16:03:43 +02:00
Marko Mäkelä
4fcfdb60e7 Merge 10.2 into 10.3 2019-11-11 14:56:51 +02:00
Marko Mäkelä
142442d571 MDEV-21024: Cleanup XDES_CLEAN_BIT
The XDES_CLEAN_BIT is always set for every element of
the page allocation bitmap in the extent descriptor pages.
Do not bother touching it, to avoid redundant writes.
2019-11-11 14:18:50 +02:00
Marko Mäkelä
878bc854d9 MDEV-21024: Clean up dict_hdr_create()
The DICT_HDR_MAX_SPACE_ID was already zero-initialized at page allocation.
2019-11-11 14:15:04 +02:00
Marko Mäkelä
33f74e8fcf MDEV-21024: Clean up IMPORT TABLESPACE
page_rec_write_field(): Remove.

dict_create_index_tree_step(): If the SYS_INDEXES.PAGE does not change,
do not update it in the data dictionary. Typically, all index page numbers
would be unchanged before and after IMPORT TABLESPACE, except if some
secondary indexes were created after loading some data.

btr_root_fseg_adjust_on_import(): Remove the redundant mtr_t* parameter.
Redo logging is disabled during the page adjustments that IMPORT TABLESPACE
is performing.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
dfdd96214b MDEV-21024: Clean up btr_root_raise_and_insert()
The root page must never have any siblings, so it is unnecessary
to clear those fields.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
fc2ca2be4e MDEV-21024: Clean up page allocation
fsp_alloc_seg_inode_page(): Ever since
commit 3926673ce7
all newly allocated pages are zero-initialized.
Assert that this is the case for the FSEG_ID fields.
2019-11-11 14:14:26 +02:00
Marko Mäkelä
98e1d603bf MDEV-21024: Optimize writing BTR_EXTERN_LEN
btr_store_big_rec_extern_fields(): Remove the redundant initialization
of the most significant 32 bits of BTR_EXTERN_LEN. InnoDB never supported
BLOBs that are longer than 4GiB. In fact, dtuple_convert_big_rec()
would write emit an error message if a clustered index record tuple would
exceed 1,000,000,000 bytes in length.

The BTR_EXTERN_LEN in the BLOB pointers in clustered index leaf page
records is zero-initialized at least since
commit 41bb3537ba
2019-11-11 14:14:26 +02:00
Marko Mäkelä
3621df70ca MDEV-21024: Clean up rtr_adjust_upper_level()
Remove the unnecessary retrieval and null-modifications of
the preceding page.
2019-11-11 14:14:20 +02:00
Marko Mäkelä
29d67d051a Cleanup btr_page_get_prev(), btr_page_get_next()
Remove the redundant parameter mtr_t*.

Make use of page_has_prev(), page_has_next() whenever possible.
2019-11-11 13:36:21 +02:00
Marko Mäkelä
1d2458f813 MDEV-21024: Clean up rtr_adjust_upper_level()
Remove the unnecessary retrieval and null-modifications of
the preceding page.
2019-11-11 13:26:19 +02:00
Andrei Elkin
13db50fc03 MDEV-19376 Repl_semi_sync_master::commit_trx assertion failure: ... || !m_active_tranxs->is_tranx_end_pos(trx_wait_binlog_name, trx_wait_binlog_pos)
The assert indicates that the current transaction got caught uncleaned from
the semisync master's cache when it is signaled to proceed upon its
ack receive.

The reason of missed cleanup turns out to be a flaw in the gtid
connect mode.
A submitted by connecting slave value of its last received event's
binlog file *name* was adopted into
{{Repl_semi_sync_master::m_reply_file_name}} as a part of semisync
initialization.

Notice that the initialization still refines the position part of the
submitted last received event's binlog coordinates.
The master side binlog filename:pos refinement is
specific to the gtid connect mode for purpose of computing the latest
binlog file to resume slave feeding from.
Effectively in the gtid connect mode the computed resumption filename:pos
may appear smaller in which case a new post-connect time committing
transaction may be logged with its filename:pos also less than the
submitted coordinates and that triggers the assert.

Fixed with making the semisync initialization to use the refined filename:pos.
It is guaranteed to be less than any new generated transaction's binlog:pos.
2019-11-10 16:16:37 +02:00
Daniel Bartholomew
c4ee8a306b
bump the VERSION 2019-11-08 09:52:10 -05:00
Daniel Bartholomew
cbf5f6d6b5
bump the VERSION 2019-11-08 09:51:11 -05:00
Daniel Bartholomew
dfd2d3d861
bump the VERSION 2019-11-08 09:50:14 -05:00
Hartmut Holzgraefe
c4a844ca51 MDEV-20981 wsrep_sst_mariabackup fails silently when mariabackup is not installed (#1406)
Make sure failure to find mariabackup binary does not terminate
the script silently, terminate with a clear error message instead
2019-11-08 09:03:49 +02:00
Varun Gupta
b1ab2ba583 MDEV-20519: Query plan regression with optimizer_use_condition_selectivity > 1
The issue here is the wrong estimate of the cardinality of a partial join,
the cardinality is too high because the function table_cond_selectivity()
returns an absurd number 100 while selectivity cannot be greater than 1.

When accessing table t by outer reference t1.a via index we do not perform any
range analysis for t. Yet we see TABLE::quick_key_parts[key] and
TABLE->quick_rows[key] contain a non-zero value though these should have been
remained untouched and equal to 0.

Thus real cause of the problem is that TABLE::init does not clean the arrays
TABLE::quick_key_parts[] and TABLE::>quick_rows[].
It should have done it because the TABLE structure created for any
instance of a table can be reused for many queries.
2019-11-07 15:24:21 +05:30
Marko Mäkelä
352e766787 MDEV-20934: Make the test more robust
Due to MDEV-12288, the slow shutdown in MariaDB 10.3 will include
resetting the DB_TRX_ID for all inserted records. This might
cause the 60-second shutdown_server timeout to be exceeded.
Let us wait for the purge to complete before initiating slow shutdown.
2019-11-06 17:56:56 +02:00
Marko Mäkelä
908ca4668d Merge 10.2 into 10.3 2019-11-06 13:14:31 +02:00
Marko Mäkelä
90451a5981 Follow-up to 792c9f9a49
dict_index_add_to_cache(): Make the 'index' a reference to a pointer,
so that the caller will avoid the expensive call to
dict_index_get_if_in_cache_low().
2019-11-06 13:01:34 +02:00
Marko Mäkelä
8688ef22c2 Merge 10.1 to 10.2 2019-11-06 10:18:51 +02:00
Marko Mäkelä
d7a2401750 MDEV-20934 Infinite loop on innodb_fast_shutdown=0 with inconsistent change buffer
Due to a data corruption bug that may have occurred a long time earlier
(possibly involving physical backup and MySQL Bug #69122, which was
addressed in commit f166ec71b7)
it seems possible that the InnoDB change buffer might end up containing
entries, while no buffered changes exist according to the change buffer
bitmap pages in the .ibd files.

ibuf_delete_recs(): New function, to be invoked on slow shutdown only.
Remove all buffered changes for a specific page.

ibuf_merge_or_delete_for_page(): If the change buffer bitmap is clean
and a slow shutdown is in progress, invoke ibuf_delete_recs().
We do not want to do that during normal operation, due to the additional
overhead that is involved. The bitmap page should be consistent with
the change buffer in the first place.
2019-11-06 08:48:48 +02:00
Marko Mäkelä
4e99e67c4e Merge 5.5 into 10.1 2019-11-06 08:17:03 +02:00
Thirunarayanan Balathandayuthapani
5c3bbbd845 MDEV-20987 InnoDB fails to start when fts table has FK relation
InnoDB: Assertion failure in file .../dict/dict0dict.cc line ...
InnoDB: Failing assertion: table->can_be_evicted

This fixes a regression that was caused by the fix of MDEV-20621
(commit a41d429765).
MySQL 5.6 (and MariaDB 10.0) introduced eviction of tables from
the InnoDB data dictionary cache. Tables that are connected to
FOREIGN KEY constraints or FULLTEXT INDEX are exempt of the eviction.
With the problematic change, a table that would already be exempt
from eviction due to FOREIGN KEY would cause the problem if there
also was a FULLTEXT INDEX defined on it.

dict_load_table(): Only prevent eviction if table->can_be_evicted holds.
2019-11-06 08:12:00 +02:00
Daniel Bartholomew
5d3bd2b75b
bump the VERSION 2019-11-05 09:57:56 -05:00
Daniel Bartholomew
7bc26de591
bump the VERSION 2019-11-05 09:56:31 -05:00
Daniel Bartholomew
6e48f3a062
bump the VERSION 2019-11-05 09:55:18 -05:00
Daniel Bartholomew
e23cb3835e
bump the VERSION 2019-11-05 09:53:45 -05:00
Vladislav Vaintroub
dc771113a6 Fix ninja build
Do not rely on existence of CMakeFiles/${target}.dir directory existence
It is not there for custom targets in Ninja build.
2019-11-05 00:20:13 +01:00
Sergei Golubchik
cd156e2c3e MDEV-20971 ASAN heap-use-after-free in list_delete / heap_close
Don't save/restore HP_INFO as it could be changed by a concurrent thread.
different parts of HP_INFO are protected by different mutexes and
the mutex that protect most of the HP_INFO does not protect its open_list
data.

As a bonus, make heap_check_heap() to take const HP_INFO* and not
make any changes there whatsoever.
2019-11-04 23:14:27 +01:00
Marko Mäkelä
5164f8c206 Fix GCC 9.2.1 -Wstringop-truncation
dict_table_rename_in_cache(): Use strcpy() instead of strncpy(),
because they are known to be equivalent in this case (the length
of old_name was already validated).

mariabackup: Invoke strncpy() with one less than the buffer size,
and explicitly add NUL as the last byte of the buffer.
2019-11-04 15:52:54 +02:00
Elena Stepanova
e1a2b12577 List of unstable tests for 10.3.19 release 2019-11-03 17:59:48 +02:00
pkubaj
eb56339b66 Fix build on !glibc/powerpc*
Do the same that newer branches do and don't include glibc-related headers on non-glibc environment.
2019-11-02 18:25:12 +04:00
Sergei Petrunia
9c6fec88b1 MDEV-17171: RocksDB Tables do not have "Creation Date"
- Add SLEEP() calls to the testcase to make it really test that the
  time doesn't change.
- Always use .frm file creation time as a creation timestamp (attempts
  to re-use older create_time when the table DDL changes are not good
  because then create_time will change after server restart)
- Use the same method names as the upstream patch does
- Use std::atomic for m_update_time
2019-11-01 21:40:10 +03:00
Varun Gupta
8afe4bba2e MDEV-20424: New default value for optimizer_use_condition-selectivity leads to bad plan
In the function prev_record_reads where one finds the different row combinations for a
subset of partial join, it did not take into account the selectivity of tables
involved in the subset of partial join.
2019-11-01 17:22:05 +05:30
Eugene Kosov
0b1bc4bf76 cleanup: replace some mtr_read_ulint() with mach_read_from_4() 2019-11-01 14:31:26 +03:00
Eugene Kosov
792c9f9a49 cleanup: get rid of dict_index_add_to_cache_w_vcol()
dict_index_add_to_cache_w_vcol(): merge with dict_index_add_to_cache()
2019-11-01 14:21:29 +03:00
Robert Bindar
6f86150ab3 MDEV-17896 Assertion `pfs->get_refcount() > 0' failed
Unfortunate DROP TEMPORARY..IF EXISTS on a regular table may allow
subsequent CREATE TABLE statements to steal away the PFS_table_share
instance from the dropped table.
2019-11-01 11:10:04 +02:00
Sergei Petrunia
9c72963d2a MDEV-17171: RocksDB Tables do not have "Creation Date"
Variant#5 of the patch:
- take creation date from the .frm file, like InnoDB does
- Update_time is in-memory only (like in InnoDB).
2019-11-01 08:57:56 +01:00
Thirunarayanan Balathandayuthapani
162f475c4b MDEV-20938 Double free of dict_foreign_t during instant ALTER TABLE
innobase_drop_foreign_try(): Don't evict and reload the dict_foreign_t
during instant ALTER TABLE if the FOREIGN KEY constraint is being
dropped.

The MDEV-19630 fix (commit 07b1a26c33)
was incomplete, because it did not cover a case where the
FOREIGN KEY constraint is being dropped.
2019-11-01 08:33:59 +02:00
Alexey Botchkov
6dce6aeceb MDEV-18244 Server crashes in ha_innobase::update_thd / ... / ha_partition::update_next_auto_inc_val.
Partition table with the AUTO_INCREMENT column we ahve to check if the
max value is properly loaded. So we need to open all tables in INSERT
PARTITION statement if necessary. Also we need to check if some
tables are pruned away and not count the max autoincrement in this case.
2019-11-01 09:39:43 +04:00
Elena Stepanova
1552b254a0 List of unstable tests for 10.2.28 release 2019-10-31 20:42:08 +02:00