Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
Sergei Golubchik
Merge branch '11.8' into 12.2
Marko Mäkelä
fixup! d7f433b53d057b6e0369d76ce4f3b62dd14fbf6c
Vlad Lesin
MDEV-31956 SSD based InnoDB buffer pool extension

In one of the practical cloud MariaDB setups, a server node accesses its
datadir over the network, but also has a fast local SSD storage for
temporary data. The content of such temporary storage is lost when the
server container is destroyed.

The commit uses this ephemeral fast local storage (SSD) as an extension of
the portion of InnoDB buffer pool (DRAM) that caches persistent data
pages. This cache is separated from the persistent storage of data files
and ib_logfile0 and ignored during backup.

The following system variables were introduced:

innodb_extended_buffer_pool_size - the size of external buffer pool
file, if it equals to 0, external buffer pool will not be used;

innodb_extended_buffer_pool_path - the path to external buffer pool
file.

If innodb_extended_buffer_pool_size is not equal to 0, external buffer
pool file will be created on startup.

Only clean pages will be flushed to external buffer pool file. There is
no need to flush dirty pages, as such pages will become clean after
flushing, and then will be evicted when they reach the tail of LRU list.

The general idea of this commit is to flush clean pages to external
buffer pool file when they are evicted.

A page can be evicted either by transaction thread or by background
thread of page cleaner. In some cases transaction thread is waiting for
page cleaner thread to finish its job. We can't do flushing in external
buffer pool file when transaction threads are waithing for eviction,
that would heart performance. That's why the only case for flushing is
when page cleaner thread evicts pages in background and there are no
waiters. For this purprose buf_pool_t::done_flush_list_waiters_count
variable was introduced, we flush evicted clean pages only if the
variable is zeroed.

Clean pages are evicted in buf_flush_LRU_list_batch() to keep some
amount of pages in buffer pool's free list. That's why we flush every
second page to external buffer pool file, otherwise there could be not
enought amount of pages in free list to let transaction threads to
allocate buffer pool pages without page cleaner waiting. This might be
not a good solution, but this is enought for prototyping.

External buffer pool page is introduced to store information in buffer
pool page hash about the certain page can be read from external buffer
pool file. The first several members of such page must be the same as the
members of internal page. External page frame must be equal to the
certain value to disthinguish external page from internal one. External
buffer pages are preallocated on startup in external pages array. We
could get rid of the frame in external page, and check if the page's
address belongs to the array to distinguish external and internal pages.

There are also external pages free and LRU lists. When some internal page
is decided to be flushed in external buffer pool file, a new external
page is allocated eighter from the head of external free list, or from
the tail of external LRU list. Both lists are protected with
buf_pool.mutex. It makes sense, because a page is removed from internal
LRU list during eviction under buf_pool.mutex.

Then internal page is locked and the allocated external page is attached
to io request for external buffer pool file, and when write request is
completed, the internal page is replaced with external one in page hash,
external page is pushed to the head of external LRU list and internal
page is unlocked. After internal page was removed from external free list,
it was not placed in external LRU, and placed there only
after write completion, so the page can't be used by the other threads
until write is completed.

Page hash chain get element function has additional template parameter,
which notifies the function if external pages must be ignored or not. We
don't ignore external pages in page hash in two cases, when some page is
initialized for read and when one is reinitialized for new page creating.

When an internal page is initialized for read and external page with the
same page id is found in page hash, the internal page is locked,
the external page in replaced with newly initialized internal page in the
page hash chain, the external page is removed from external LRU list and
attached to io request to external buffer pool file. When the io request
is completed, external page is returned to external free list,
internal page is unlocked. So during read external page absents in both
external LRU and free lists and can't be reused.

When an internal page is initialized for new page creating and external
pages with the same page id is found in page hash, we just remove external
page from the page hash chain and external LRU list and push it to the
head of external free list. So the external page can be used for future
flushing.

The pages are flushed to and read from external buffer pool file with
the same manner as they are flushed to their spaces, i.e. compressed and
encrypted pages stay compressed and encrypted in external buffer pool
file.
Dave Gosselin
MDEV-35765 ST_OVERLAPS wrong result when dim(geom1) <> dim(geom2)

Validates that the two geometries passed to ST_OVERLAPS have the
same number of dimensions.
Rucha Deodhar
MDEV-38312: Server crashes when setting innodb_default_encryption_key_id
after enabling hashicorp and test_sql_service plugins

Analysis:
When the error occurs which results in logging it, the thread is NULL
but there is still an attempt to access the port value from the thd.

Fix:
In case the thd is NULL, assign 0.
Sergei Golubchik
Merge branch '11.8' into 12.2
Marko Mäkelä
squash! ace04ae158e71dbd0209bfc4410c5882b109b332

log_t::write_checkpoint(): Only make a previous archive log file read-only.

TODO: rewrite is_mmap(), allow log_sys.log to remain open for
memory-mapped archived log
Dave Gosselin
MDEV-38177: FULL OUTER JOIN Allowed JOIN Orders

Check that tables participating in a FULL OUTER JOIN are not separated from
each other when trying new extenions to the query plan.  Some tables t1, t2
participating in FULL OUTER JOIN should remain adjacent in the final JOIN
order, otherwise wrong results will be computed.

In this patch, tables in a FULL OUTER JOIN remember who their JOIN partner
is.  When JOINs are nested, these partners are preserved and checked
when walking the nested JOIN tree during check_interleaving_in_nj.
This code accounts for the case when tables in a FULL OUTER JOIN may
themselves be nested joins, such as (t1, t2) FULL OUTER JOIN t3.
Monty
MDEV-23298 Assertion `table_list->prelocking_placeholder == TABLE_LIST::PRELOCK_NONE' failed in check_lock_and_start_stmt on CREATE OR REPLACE TABLE

Fixed by removing wrong assert

Review: Sanja Byelkin
Kristian Nielsen
Fix leaving system table as InnoDB engine

Fix the test case main.servers to restore the table mysql.servers back to Aria
engine, not leave it changed to InnoDB. This was causing the test case
innodb.innodb_stats to fail sporadically if it was run after main.servers.

Signed-off-by: Kristian Nielsen <[email protected]>
Yuchen Pei
MDEV-38327 Do not use rowid filter when using index merge with [sort] intersection
Dearsh Oberoi
MDEV-38194 Correct classification of MASTER_SSL_VERIFY_SERVER_CERT

This patch removes MASTER_SSL_VERIFY_SERVER_CERT from the list
reserved_keyword_udt_not_param_type and adds it to
keyword_func_sp_var_and_label in the parser. All other MASTER_SSL_* keywords
are in this list.

This allows MASTER_SSL_VERIFY_SERVER_CERT to be used unquoted when directly
accessed via INFORMATION_SCHEMA.slave_status, as well as opens it up to be
used as names in other places, e.g. stored procedures.

Reviewed-by: Brandon Nesterenko <[email protected]>
Rucha Deodhar
MDEV-22675: Assertion `offset < table->s->reclength' failed in dump_leaf_key

Analysis:
The reclength depends on the size of each field of the temporary table plus
the null_bytes. Since null_bytes is 0 (because we’re in non-strict mode and
the source table fields can never be null), there is no need to keep track
of null values. Hence the total record length is just the sum of the sizes
of both fields. The second field will always have size 0 because its value
will always be an empty string. Hence it starts exactly where the first
field ends which equal to reclength. Hence the assertion failure.

Fix:
If pack_length() is 0 (which means the size of field is 0) so assing the
result as empty string directly, the assertion is not valid in that case.
Rucha Deodhar
MDEV-30086: Character set 'utf8' is not a compiled character set and is
not specified in the '/usr/share/mysql/charsets/Index.xml' file

Analysis:
We can get rid of the alias because the alias depends on flag whether utf8
means utf8mb3 or utf8mb4. But it does miss the utf8mb4 charset.

Fix:
Added the utf8mb4 charset as discussed.
Daniel Black
MDEV-38313 Add WantedBy=sockets.target to systemd socket definations

mariadb.socket and others need a Install section to include the
WantedBy=sockets.target. This is consistent with other socket
definations of systemd.

Thanks Mark Bolhuis for the bug report.
Rucha Deodhar
MDEV-36764: Unexpected collation when using json_table

Analysis:
The collation is hard coded.

Fix:
The collation should be derived from the database collation instead of
being hard coded.
Monty
Disable innodb_gis.rtree_split until MDEV-38373 is fixed
Monty
Added --with-asan to compile-pentium64-asan-max

This was needed to get rid of compilation problems with
-Wframe-larger-than=16384
Monty
MDEV-25292 Atomic CREATE OR REPLACE TABLE

Atomic CREATE OR REPLACE allows to keep an old table intact if the
command fails or during the crash. That is done by renaming the
original table to temporary name, as a backup and restoring it if the
CREATE fails. When the command is complete and logged the backup
table is deleted.

Atomic replace algorithm

  Two DDL chains are used for CREATE OR REPLACE:
  ddl_log_state_create (C) and ddl_log_state_rm (D).

  1. (C) Log rename of ORIG to TMP table (Rename TMP to original).
  2. Rename orignal to TMP.
  3. (C) Log CREATE_TABLE_ACTION of ORIG (drops ORIG);
  4. Do everything with ORIG (like insert data)
  5. (D) Log drop of TMP
  6. Write query to binlog (this marks (C) to be closed in
    case of failure)
  7. Execute drop of TMP through (D)
  8. Close (C) and (D)

  If there is a failure before 6) we revert the changes in (C)
  Chain (D) is only executed if 6) succeded (C is closed on
  crash recovery).

Foreign key errors will be found at the 1) stage.

Additional notes

  - CREATE TABLE without REPLACE and temporary tables is not affected
    by this commit.
    set @@drop_before_create_or_replace=1 can be used to
    get old behaviour where existing tables are dropped
    in CREATE OR REPLACE.

  - CREATE TABLE is reverted if binlogging the query fails.

  - Engines having HTON_EXPENSIVE_RENAME flag set are not affected by
    this commit. Conflicting tables marked with this flag will be
    deleted with CREATE OR REPLACE.

  - Replication execution is not affected by this commit.
    - Replication will first drop the conflicting table and then
      creating the new one.

  - CREATE TABLE .. SELECT XID usage is fixed and now there is no need
    to log DROP TABLE via DDL_CREATE_TABLE_PHASE_LOG (see comments in
    do_postlock()). XID is now correctly updated so it disables
    DDL_LOG_DROP_TABLE_ACTION. Note that binary log is flushed at the
    final stage when the table is ready. So if we have XID in the
    binary log we don't need to drop the table.

  - Three variations of CREATE OR REPLACE handled:

    1. CREATE OR REPLACE TABLE t1 (..);
    2. CREATE OR REPLACE TABLE t1 LIKE t2;
    3. CREATE OR REPLACE TABLE t1 SELECT ..;

  - Test case uses 6 combinations for engines (aria, aria_notrans,
    myisam, ib, lock_tables, expensive_rename) and 2 combinations for
    binlog types (row, stmt). Combinations help to check differences
    between the results. Error failures are tested for the above three
    variations.

  - expensive_rename tests CREATE OR REPLACE without atomic
    replace. The effect should be the same as with the old behaviour
    before this commit.

  - Triggers mechanism is unaffected by this change. This is tested in
    create_replace.test.

  - LOCK TABLES is affected. Lock restoration must be done after new
    table is created or TMP is renamed back to ORIG

  - Moved ddl_log_complete() from send_eof() to finalize_ddl(). This
    checkpoint was not executed before for normal CREATE TABLE but is
    executed now.

  - CREATE TABLE will now rollback also if writing to the binary
    logging failed. See rpl_gtid_strict.test

backup ddl log changes

- In case of a successfull CREATE OR REPLACE we only log
  the CREATE event, not the DROP TABLE event of the old table.

ddl_log.cc changes

  ddl_log_execute_action() now properly return error conditions.
  ddl_log_disable_entry() added to allow one to disable one entry.
  The entry on disk is still reserved until ddl_log_complete() is
  executed.

On XID usage

  Like with all other atomic DDL operations XID is used to avoid
  inconsistency between master and slave in the case of a crash after
  binary log is written and before ddl_log_state_create is closed. On
  recovery XIDs are taken from binary log and corresponding DDL log
  events get disabled.  That is done by
  ddl_log_close_binlogged_events().

On linking two chains together

  Chains are executed in the ascending order of entry_pos of execute
  entries. But entry_pos assignment order is undefined: it may assign
  bigger number for the first chain and then smaller number for the
  second chain. So the execution order in that case will be reverse:
  second chain will be executed first.

  To avoid that we link one chain to another. While the base chain
  (ddl_log_state_create) is active the secondary chain
  (ddl_log_state_rm) is not executed. That is: only one chain can be
  executed in two linked chains.

  The interface ddl_log_link_chains() was defined in "MDEV-22166
  ddl_log_write_execute_entry() extension".

Atomic info parameters in HA_CREATE_INFO

  Many functions in CREATE TABLE pass the same parameters. These
  parameters are part of table creation info and should be in
  HA_CREATE_INFO (or whatever). Passing parameters via single
  structure is much easier for adding new data and
  refactoring.

InnoDB changes
  Added ha_innobase::can_be_renamed_to_backup() to check if
  a table with foreign keys can be renamed.

Aria changes:
- Fixed issue in Aria engine with CREATE + locked tables
  that data was not properly commited in some cases in
  case of crashes.

Other changes:
- Removed some auto variables in log.cc for better code readability.
- Fixed old bug that CREATE ... SELECT would not be able to auto repair
  a table that is part of the SELECT.
- Marked MyISAM that it does not support ROLLBACK (not required but
  done for better consistency with other engines).

Known issues:
- InnoDB tables with foreign key definitions are not fully supported
  with atomic create and replace:
  - ha_innobase::can_be_renamed_to_backup() can detect some cases
    where InnoDB does not support renaming table with foreign key
    constraints.  In this case MariaDB will drop the old table before
    creating the new one.
    The detected cases are:
    - The new and old table is using the same foreign key constraint
      name.
    - The old table has self referencing constraints.
  - If the old and new table uses the same name for a constraint the
    create of the new table will fail. The orignal table will be
    restored in this case.
  - The above issues will be fixed in a future commit.
- CREATE OR REPLACE TEMPORARY table is not full atomic. Any conflicting
  table will always be dropped before creating a new one. (Old behaviour).

Bug fixes related to this MDEV:

MDEV-36435 Assertion failure in finalize_locked_tables()
MDEV-36439 Assertion `thd_arg->lex->sql_command != SQLCOM_CREATE_SEQUENCE...
MDEV-36498 Failed CoR in non-atomic mode no longer generates DROP in RBR...
MDEV-36508 Temporary files #sql-create-....frm occasionally stay after
          crash recovery
MDEV-38479 Crash in CREATE OR REPLACE SEQUENCE when new sequence cannot
          be created
MDEV-36497 Assertion failure after atomic CoR with Aria under lock in
          transactional context

InnoDB related changes:
- ha_innodb::rename_table() does not handle foreign key constraint
  when renaming an normal table to internal tempory tables. This
  causes problems for CREATE OR REPLACE as the old constraints causes
  failure when creating a new table with the same constraints.
  This is fixed inside InnoDB by not threating tempfiles (#sql-create-..),
  created as part of CREATE OR REPLACE, as temporary files.
- In ha_innobase::delete_table(), ignore checking of constraints when
  dropping a #sql-create temporary table.
- In tablename_to_filename() and filename_to_tablename(), don't do
  filename conversion for internal temporary tables (#sql-...)

Other things:
- maria_create_trn_for_mysql() does not register a new transaction
  handler for commits. This was needed to ensure create or replace
  will not end with an active transaction.
- We do not get anymore warnings about "Engine not supporting atomic
  create" when doing a legal CREATE OR REPLACE on a table with
  foreign key constraints.
- Updated VIDEX engine flags to disable CREATE SEQUENCE.

Reverted commits:
MDEV-36685 "CREATE-SELECT may lose in binlog side-effects of
stored-routine" as it did not take into account that it safe to clear
binlogs if the created table is non transactional and there are no
other non transactional tables used.
- This was done because it caused extra logging when it is not needed
  (not using any non transactional tables) and it also did not solve
  side effects when using statement based loggging.
Yuchen Pei
MDEV-38327 [demo] Do not use rowid filter if using index merge with [sort] intersect
ParadoxV5
Fix tests

way too many of them, and there are more… x.x
Oleksandr Byelkin
MDEV-36888 Assertion `typeid(*copy) == typeid(*this)' in Item_func_or_sum::do_build_clone

Problems was in forgotten Item type in two places: clone and finding origin field.

The handling added.
Rucha Deodhar
MDEV-38312: Server crashes when setting innodb_default_encryption_key_id
after enabling hashicorp and test_sql_service plugins

Analysis:
When the error occurs which results in logging it, the thread is NULL
but there is still n attempt to access the port value from the thd.

Fix:
In case the thd is NULL, assign 0.
Otto Kekäläinen
MDEV-37098 Fix Spider test failures in network-less environments

When running tests in environments without a network interface (e.g.
Podman container launched with `--network=none`), Spider was not able to
retrieve a hardware address to generate a node ID. This triggered a
warning in the server log, causing MTR to fail multiple Spider tests due
to unexpected warnings and output result mismatches with:

    [Warning] mariadbd: Can't get hardware address with error 2

Fix this by logging Spider hardware address errors to server log only
by setting it as a NOTE. This does not pollute the client output.

When`my_gethwaddr` fails, the code zeroes out the address buffer,
resulting in a `spider_unique_id` formatted like `-000000000000-PID-`,
which is fully valid and emitting warnings was a bit overkill to begin
with.
Marko Mäkelä
squash! d7f433b53d057b6e0369d76ce4f3b62dd14fbf6c

log_sys.log: Retain open when innodb_log_archive=ON, also for PMEM.

FIXME: Implement multi-file innodb_log_archive=ON recovery,
first for regular file I/O, then for memory-mapped log.
Monty
Update Galera test results
Marko Mäkelä
squash! ace04ae158e71dbd0209bfc4410c5882b109b332

log_t::attach(), log_t::set_archive(): For memory-mapped archived log,
retain resize_log as an open file handle.

log_t::clear_mmap(): Clean up the logic.

srv_log_rebuild_if_needed(): Never rebuild if innodb_log_archive=ON.
Kristian Nielsen
MDEV-37862: innodb.gap_locks test failure: 0 lock structs, 0 row locks

The test fails sporadically due to an insufficient --replace_regex.
The output of SHOW ENGINE INNODB STATUS can have some "not started"
transactions in additional to the "ACTIVE" transaction the test wants to
display, and the --replace_regex would wrongly pick one of the "not started"
transactions to show if it occured after the "ACTIVE" one in the output.

Signed-off-by: Kristian Nielsen <[email protected]>
Marko Mäkelä
Make Wintendo build again
Dave Gosselin
MDEV-38177: FULL OUTER JOIN Allowed JOIN Orders

This is a small cleanup commit ahead of the feature work for this MDEV:
- Upgrade JOIN::get_allowed_nj_tables, JOIN::calc_allowed_top_level_tables
  to const methods as they have no side-effects and don't mutate object state
- Document that JOIN_TAB::tab_list is the same as
  JOIN_TAB::table->pos_in_table_list
- Direct access to nj_map replaced by functions to clarify expected usage
- Remove a dead code path not executed by any regression tests
- Invert and dedent a couple of loops to keep the happy path on the left
- Cleanup restore_prev_nj_state and build_bitmap_for_nested_joins
Oleksandr Byelkin
MDEV-35288 Assertion `!is_cond()' failed in virtual longlong Item_bool_func::val_int()

Boolean function now uses val_bool to get string result (val_str())
Sergei Golubchik
Merge branch '11.8' into 12.2
ParadoxV5
MDEV-4698 snapshot 3

* Fix `show_relaylog_events.inc` (?)
* Create an MTR test to demonstrate the (fixing) change
* Remove unnecessary assertion,
  which fails when `rpl.rpl_gtid_stop_start` tests MDEV 4650.
* Reindent `#ifdef` & `#endif` to column 0 per `CODING_STANDARDS.md`
Marko Mäkelä
squash! ace04ae158e71dbd0209bfc4410c5882b109b332

recv_sys_t::find_checkpoint(): Open non-last archived log files in
read-only mode.
Marko Mäkelä
Merge 10.6 into 10.11
ParadoxV5
Merge branch '10.11' into MDEV-4698