Commit graph

188637 commits

Author SHA1 Message Date
Marko Mäkelä
db5cdc3195 MDEV-12353: Replace MLOG_PAGE_REORGANIZE, MLOG_COMP_PAGE_REORGANIZE
Log page reorganize as a series of insert operations.
This will make the redo log volume proportional to the page payload size.

btr_page_reorganize_low(): Add template <bool recovery=false>

btr_page_reorganize_block(): Remove the parameter 'bool recovery'
2020-02-13 18:19:14 +02:00
Marko Mäkelä
276f996af9 MDEV-12353: Replace MLOG_*_END_COPY_CREATED
Instead of writing the high-level redo log records
MLOG_LIST_END_COPY_CREATED, MLOG_COMP_LIST_END_COPY_CREATED
write log for each individual insert of a record.

page_copy_rec_list_end_to_created_page(): Remove.

This will improve the fill factor of some pages.
Adjust some tests accordingly.

PageBulk::init(), PageBulk::finish(): Avoid setting bogus limits
to PAGE_HEAP_TOP and PAGE_N_DIR_SLOTS. Avoid accessor functions
that would enforce these limits before the correct ones are set
at the end of PageBulk::finish().
2020-02-13 18:19:14 +02:00
Marko Mäkelä
acd265b69b MDEV-12353: Exclusively use page_zip_reorganize() for ROW_FORMAT=COMPRESSED
page_zip_reorganize(): Restore the page on failure.
In callers, omit now-redundant calls to page_zip_decompress().

btr_page_reorganize_low(): Define in static scope only, and
remove the z_level parameter. Assert that ROW_FORMAT is not COMPRESSED.

btr_page_reorganize_block(), btr_page_reorganize(): Invoke
page_zip_reorganize() for ROW_FORMAT=COMPRESSED.
2020-02-13 18:19:14 +02:00
Marko Mäkelä
f802c989ec MDEV-12353: Replace MLOG_UNDO_INSERT
trx_undof_page_add_undo_rec_log(): Remove.

trx_undo_page_set_next_prev_and_add(), trx_undo_page_report_modify(),
trx_undo_page_report_rename(): Write lower-level redo log records.
2020-02-13 18:19:14 +02:00
Marko Mäkelä
e0bc29df18 MDEV-12353: Replace MLOG_UNDO_HDR_CREATE
trx_undo_header_create(): Emit lower-level records instead of
writing MLOG_UNDO_HDR_CREATE records.
2020-02-13 18:19:13 +02:00
Marko Mäkelä
737b701786 MDEV-12353: Remove trx_undo_erase_page_end()
MariaDB stopped writing the record MLOG_UNDO_ERASE_END
in commit 0fd3def284 (10.3.3).
Merge trx_undo_erase_page_end() with its callers.
2020-02-13 18:19:13 +02:00
Marko Mäkelä
07d39cde92 MDEV-12353: Replace MLOG_UNDO_INIT
trx_undo_page_init(): Write lower-level redo log records by
invoking mtr_t::write().
2020-02-13 18:19:13 +02:00
Marko Mäkelä
5bea43f5e0 MDEV-12353: Deprecate and ignore innodb_log_compressed_pages
page_zip_compress_write_log_no_data(): Remove.
We no longer write the MLOG_ZIP_PAGE_COMPRESS_NO_DATA record.
Instead, we will write MLOG_ZIP_PAGE_COMPRESS records.
2020-02-13 18:19:13 +02:00
Marko Mäkelä
600eae9179 MDEV-12353: Remove MTR_LOG_SHORT_INSERTS
No longer emit the redo log records
MLOG_LIST_END_COPY_CREATED, MLOG_COMP_LIST_END_COPY_CREATED.
2020-02-13 18:19:13 +02:00
Vicențiu Ciorbaru
ac51bcfd8d Update rdiff for sysvars 32bit to account for removed options 2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
efa9079fbd Fix compilation error due to type mismatch in tpool_generic.cc
size_t compared to int
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
ad17aa110c MDEV-18650: Options deprecated in previous versions - multi_range_count
Remove deprecated system variable multi_range_count. It was ignored from 5.3.
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
5aebd78e27 MDEV-18650: Options deprecated in previous versions - mroonga_default_parser
Variable is marked as deprecated since 10.1.6. Update tests to not make
use of it.
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
a05b38c120 MDEV-18650: Options deprecated in previous versions - skip-bdb
Remove the option from mysqld --help text.
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
8bbcaab160 MDEV-18650: Options deprecated in previous versions - thread_concurrency
thread_concurrency was ignored since 5.5. Remove it.
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
fc5a4cfdf5 MDEV-18650: Options deprecated in previous versions - old_alter_table
It was deprecated in 5.5 but it never issued a deprecation warning.
Make it issue a warning in 10.5.1.
2020-02-13 13:42:01 +02:00
Sergei Golubchik
899056cfab for every deprecated sysvar note a version when it happened 2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
1bc9cce702 Policy improvement for removed options and system variables
REMOVED OPTIONS / SYSTEM VARIABLES
  * mysqld removed options will not stop the server from starting. They
    will be silently accepted, as if --loose flag is set. Removed options
    prefixes will not interfere with existing options prefixes. They are
    consumed last.
  * mysqld removed options will not show in --help.
  * mysqld system variables will be removed according to the deprecation
    & removal timeline and not function within the client interface once
    removed.

DEPRECTATED OPTIONS / SYSTEM VARIABLES
  * mysqld deprecated options will issue a warning to the user.
  * mysqld deprecated options will still be visible in --help.
  * mysqld system variables will be removed in the next GA version that is
    past EOL of the version that deprecated the variable.
  * deprecated options / variables will not be used anywhere in the server
    code the moment they are deprecated. At most, they will act as aliases.

The advantage of this policy is that it ensures upgrades will always
allow the user to start the server, even when upgrading from a very old
version. It is still possible for user applications to break when
upgrading, as system variables set via the client interface will return
errors. However, this will happen after a long time, with lots of
warnings between versions. The expected timeline is ~ 5 years until a
deprecated variable dissapears from the server.
2020-02-13 13:42:01 +02:00
Vicențiu Ciorbaru
45bc7574fb MDEV-18650: Options deprecated in previous versions - storage_engine
Remove usage of deprecated variable storage_engine. It was deprecated in 5.5 but
it never issued a deprecation warning. Make it issue a warning in 10.5.1.

Replaced with default_storage_engine.
2020-02-13 13:42:01 +02:00
Otto Kekäläinen
415797f1a6 Deb: Run 'wrap-and-sort -a' so comparison across releases is easier 2020-02-13 09:54:22 +00:00
Marko Mäkelä
20a7f75fbf MDEV-15058: Revert the changes to INFORMATION_SCHEMA
For compatibility with diagnostic software, let us
return a dummy buffer pool identifier 0 and restore
the columns that were initially deleted in
commit 1a6f708ec5:

	information_schema.innodb_buffer_page.pool_id
	information_schema.innodb_buffer_page_lru.pool_id
	information_schema.innodb_buffer_pool_stats.pool_id
	information_schema.innodb_cmpmem.buffer_pool_instance
	information_schema.innodb_cmpmem_reset.buffer_pool_instance

Thanks to Vladislav Vaintroub for pointing this out.
2020-02-12 20:54:59 +02:00
Varun Gupta
f0606a7530 MDEV-21665: Server crashes in my_qsort2 / Filesort_buffer::sort_buffer
Allocation should use ALIGN_SIZE when we need to make sure that we
have atleast enough space to store one record in MERGEBUFF2 buffers
2020-02-12 20:16:23 +05:30
Marko Mäkelä
1a6f708ec5 MDEV-15058: Deprecate and ignore innodb_buffer_pool_instances
Our benchmarking efforts indicate that the reasons for splitting the
buf_pool in commit c18084f71b
have mostly gone away, possibly as a result of
mysql/mysql-server@ce6109ebfd
or similar work.

Only in one write-heavy benchmark where the working set size is
ten times the buffer pool size, the buf_pool->mutex would be
less contended with 4 buffer pool instances than with 1 instance,
in buf_page_io_complete(). That contention could be alleviated
further by making more use of std::atomic and by splitting
buf_pool_t::mutex further (MDEV-15053).

We will deprecate and ignore the following parameters:

	innodb_buffer_pool_instances
	innodb_page_cleaners

There will be only one buffer pool and one page cleaner task.

In a number of INFORMATION_SCHEMA views, columns that indicated
the buffer pool instance will be removed:

	information_schema.innodb_buffer_page.pool_id
	information_schema.innodb_buffer_page_lru.pool_id
	information_schema.innodb_buffer_pool_stats.pool_id
	information_schema.innodb_cmpmem.buffer_pool_instance
	information_schema.innodb_cmpmem_reset.buffer_pool_instance
2020-02-12 14:45:21 +02:00
Marko Mäkelä
0448c614c8 MDEV-16264: Remove unused page_cleaner_t::is_started 2020-02-12 11:32:09 +02:00
Marko Mäkelä
2a6fa1c42b MDEV-21132: Use memcpy_aligned, memset_aligned 2020-02-12 11:32:09 +02:00
Oleksandr Byelkin
4b087e1754 Merge branch '10.4' into 10.5 2020-02-12 08:55:17 +01:00
Marko Mäkelä
fc2f2fa853 MDEV-19747: Deprecate and ignore innodb_log_optimize_ddl
During native table rebuild or index creation, InnoDB used to skip
redo logging and write MLOG_INDEX_LOAD records to inform crash recovery
and Mariabackup of the gaps in redo log. This is fragile and prohibits
some optimizations, such as skipping the doublewrite buffer for
newly (re)initialized pages (MDEV-19738).

row_merge_write_redo(): Remove. We do not write MLOG_INDEX_LOAD
records any more. Instead, we write full redo log.

FlushObserver: Remove.

fseg_free_page_func(): Remove the parameter log. Redo logging
cannot be disabled.

fil_space_t::redo_skipped_count: Remove.

We cannot remove buf_block_t::skip_flush_check, because PageBulk
will temporarily generate invalid B-tree pages in the buffer pool.
2020-02-11 18:44:26 +02:00
Marko Mäkelä
8ccb3caafb MDEV-17491 micro optimize page_id_t further
Let us define page_id_t as a thin wrapper of uint64_t so that
the comparison operators can be simplified. This is a follow-up
to the original commit 14be814380.

The comparison operator for recv_sys.pages.emplace() turned out to be
a busy spot in a recovery benchmark. That data structure was introduced
in MDEV-19586 in commit 177a571e01.
2020-02-11 18:03:19 +02:00
Marko Mäkelä
f3dac59174 MDEV-21351: Fix a performance regression
The linear scan of recv_sys_t::blocks() in recv_sys_t::free()
turns out to dominate the execution time in crash recovery.
Let us scan the much shorter buf_pool->chunks lists instead.
2020-02-11 17:18:26 +02:00
Oleksandr Byelkin
646d1ec83a Merge branch '10.3' into 10.4 2020-02-11 14:40:35 +01:00
Jan Lindström
e6a50e41da MDEV-20051: Add new mode to wsrep_OSU_method in which Galera checks storage engine of the effected table
Introduced a new wsrep_strict_ddl configuration variable in which
Galera checks storage engine of the effected table. If table is not
InnoDB (only storage engine currently fully supporting Galera
replication) DDL-statement will return error code:

ER_GALERA_REPLICATION_NOT_SUPPORTED
       eng "DDL-statement is forbidden as table storage engine does not support Galera replication"

However, when wsrep_replicate_myisam=ON we allow DDL-statements to
MyISAM tables. If effected table is allowed storage engine Galera
will run normal TOI.

This new setting should be for now set globally on all
nodes in a cluster. When this setting is set following DDL-clauses
accessing tables not supporting Galera replication are refused:

* CREATE TABLE (e.g. CREATE TABLE t1(a int) engine=Aria
* ALTER TABLE
* TRUNCATE TABLE
* CREATE VIEW
* CREATE TRIGGER
* CREATE INDEX
* DROP INDEX
* RENAME TABLE
* DROP TABLE

Statements on PROCEDURE, EVENT, FUNCTION are allowed as effected
tables are known only at execution. Furthermore, USER, ROLE, SERVER,
DATABASE statements are also allowed as they do not really have
effected table.
2020-02-11 15:17:50 +02:00
Igor Babaev
41541a7c48 MDEV-21683 Server crashes in get_quick_keys with not_null_range_scan
ANding of the range built from inferred NOT NULL conditions and the range
built from other conditions used in WHERE/ON clauses may produce an
IMPOSSIBLE range. The code of MDEV-15777 did not take into account this
possibility.
2020-02-10 21:20:17 -08:00
Alexander Barkov
83e75b39b3 MDEV-21702 Add a data type for privileges 2020-02-11 08:10:26 +04:00
Oleksandr Byelkin
58b70dc136 Merge branch '10.2' into 10.3 2020-02-10 20:34:16 +01:00
Aleksey Midenkov
f79f537f9f MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func 2020-02-10 21:57:27 +03:00
Anel Husakovic
235d7c6f54 Ignore /lib64 for rpm 2020-02-10 14:32:10 +01:00
Oleksandr Byelkin
594282a534 Merge branch '10.1' into 10.2 2020-02-10 14:31:39 +01:00
Oleksandr Byelkin
716161ea03 Merge branch '5.5' into 10.1 2020-02-10 14:18:00 +01:00
Vladislav Vaintroub
b08579aa28 MDEV-16308 : protocol messed up sporadically
Context involves semicolon batching, and the error starts 10.2
No reproducible examples were made yet, but TCP trace suggests
multiple packets that are "squeezed" together (e.g overlong OK packet
that has a trailer which is belongs to another packet)

Remove thd->get_stmt_da()->set_skip_flush() when processing a batch.
skip_flush stems from the COM_MULTI code, which was checked in during
10.2 (and is never used)

The fix is confirmed to work, when evaluated by bug reporter (one of them)

We never reproduced it locally, with multiple tries
thus the root cause analysis is still missing.
2020-02-10 12:44:53 +01:00
Jan Lindström
d72038a738 MDEV-21667 : Galera test failure on MW-336
Problem seems to be the fact that we did not enforce correct
applier thread numbers after every command that effects them.
Test changes only.
2020-02-09 13:03:35 +02:00
Jan Lindström
a30ab52635 MDEV-21601 : Cleanup Galera disabled tests
* Remove those tests that will not be supported on that release.
* Make sure that correct tests are disabled and have MDEVs
* Sort test names

This should not be merged upwards.
2020-02-09 13:03:28 +02:00
Jan Lindström
6fc72ce169 MDEV-21667 : Galera test failure on MW-336
Problem seems to be the fact that we did not enforce correct
applier thread numbers after every command that effects them.
Test changes only.
2020-02-09 08:55:26 +02:00
Jan Lindström
0ea8894e52 MDEV-21601 : Cleanup Galera disabled tests
* Remove those tests that will not be supported on that release.
* Make sure that correct tests are disabled and have MDEVs
* Sort test names

This should not be merged upwards.
2020-02-09 08:55:26 +02:00
Alexander Barkov
77c6382312 MDEV-21689 Add Sql_cmd for GRANT/REVOKE statements
Rewriting GRANT/REVOKE grammar to use more bison stack and use Sql_cmd_ style

1. Removing a few members from LEX:
   - uint grant, grant_to_col, which_columns
   - List<LEX_COLUMN> columns
   - bool all_privileges
2. Adding classes Grand_object_name, Lex_grant_object_name
3. Adding classes Grand_privilege, Lex_grand_privilege
4. Adding struct Lex_column_list_privilege_st, class Lex_column_list_privilege
5. Rewriting the GRANT/REVOKE grammar to use new classes and pass them through
   bison stack (rather than directly access LEX members)
6. Adding classes Sql_cmd_grant* and Sql_cmd_revoke*,
   changing GRANT/REVOKE to use LEX::m_sql_cmd.
7. Adding the "sp_handler" grammar rule and removing some duplicate grammar
   for GRANT/REVOKE for different kinds of SP objects.
8. Adding a new rule comma_separated_ident_list, reusing it in:
   - with_column_list
   - colum_list_privilege
2020-02-08 21:35:35 +04:00
Marko Mäkelä
e568dc9723 Remove unused SRV_MASTER_PURGE_INTERVAL
The symbol SRV_MASTER_PURGE_INTERVAL became unused in
mysql/mysql-server@42f3691958
when separate purge threads were introduced in MySQL 5.6.5.
2020-02-08 18:58:28 +02:00
Marko Mäkelä
06b0623adb Cleanup: Aligned InnoDB index page header access
ut_align_down(): Preserve the const qualifier. Use C++ casts.

ha_delete_hash_node(): Correct an assertion expression.

fil_page_get_type(): Perform an assumed-aligned read.

page_align(): Preserve the const qualifier. Assume (some) alignment.

page_get_max_trx_id(): Check the index page type.

page_header_get_field(): Perform an assumed-aligned read.

page_get_autoinc(): Perform an assumed-aligned read.

page_dir_get_nth_slot(): Perform an assumed-aligned read.
Preserve the const qualifier.
2020-02-08 14:12:59 +02:00
Marko Mäkelä
c5856b0a68 MDEV-21351: Allocate aligned memory
recv_sys_t::ALIGNMENT: The recv_sys_t::alloc() alignment
2020-02-08 11:47:42 +02:00
Marko Mäkelä
6eed99f1f3 MDEV-21248: Do not break the build on clang 2020-02-08 11:40:55 +02:00
Martin Liska
35c2778519 MDEV-21248: Prevent optimizing out buf argument in check_stack_overrun.
When using LTO, one can see optimization of stack variables that
are passed to check_stack_overrun as argument buf. That prevents
proper stack overrun detection.
2020-02-08 05:50:01 +01:00
Igor Babaev
8d7462ec49 MDEV-21614 Wrong query results with optimizer_switch="split_materialized=on"
Do not materialize a semi-join nest if it contains a materialized derived
table /view that potentially can be subject to the split optimization.
Splitting of materialization of such nest would help, but currently there
is no code to support this technique.
2020-02-07 19:48:35 -08:00