maria:bb-10.9-mdev-31401-demo-udf-initialized

Last commit made on 2023-06-13
Get this branch:
git clone -b bb-10.9-mdev-31401-demo-udf-initialized https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.9-mdev-31401-demo-udf-initialized
Repository:
lp:maria

Recent commits

91176a7... by Yuchen Pei

MDEV-31401 [demo] mysqld_server_started is no substitute for udf_initialized

...when it comes to decide whether to insert into mysql.func or create
function. The test udf_mysql_func_early fails.

a2e71bc... by Yuchen Pei

MDEV-22979 MDEV-31400 Fixing spider init bugs

Fix spider init bugs (MDEV-22979, MDEV-27233, MDEV-28218) and while
preventing regression on old ones (MDEV-30370, MDEV-29904)

Three things are changed:

First, Spider initialisation is made fully synchronous, i.e. it no
longer happens in a background thread. Adapted from the original fix
by nayuta for MDEV-27233. This change itself would cause failure when
spider is initialised early, by plugin-load-add, due to dependency on
Aria and udf function creation, which are fixed in the second and
third parts below. Requires SQL Service, thus porting earlier versions
requires MDEV-27595

Second, we introduce simple plugin dependency. During initialisation
of all plugins, failed plugins may be retried, until no more plugins
succeed in initialisation or want to be retried.

Because it may be impossible to clean up after a failed plugin
initialisation*, we interpret a specific error code (-1) returned from
the plugin init function as a request for retry.

* Take InnoDB for example, it has a global variable
`buf_page_cleaner_is_active`, which may not satisfy an assertion
during a second initialisation try, probably because InnoDB does not
expect the initialisation to be called twice. A test that may fail
because of this is `encryption.corrupted_during_recovery`, see for
example[1], which is tested at
73835f64b7fc245d38812380685aca03bef72bb5, a previous commit where we
retry every failed plugin.

[1] https://buildbot.mariadb.org/#/builders/369/builds/10107/steps/7/logs/stdio

Third, if spider is initialised before udf_init(), create udf by
inserting into `mysql.func`, otherwise do it by `CREATE FUNCTION` as
usual. This change may be generalised in MDEV-31401.

Also factor out some clean-up queries from deinit_spider.inc for use
of spider init tests.

A minor caveat is that early spider initialisation will fail if the
server is bootstrapped for the first time, due to missing `mysql`
database which needs to be created by the bootstrap script.

cb0e0c9... by Yuchen Pei

MDEV-27095 clean up spd_init_query.h

Removing procedures that were created and dropped during init.

This also fixes a race condition where mtr test with
plugin-load-add=ha_spider.so causes post test check to fail as it
expects the procedures to still be there.

27f3396... by Yuchen Pei

MDEV-27095 installing one spider plugin should not trigger others

There are several plugins in ha_spider: spider, spider_alloc_mem,
spider_wrapper_protocols, spider_rewrite etc.

INSTALL PLUGIN foo SONAME ha_spider causes all the other ones to be
installed by the init queries where foo is any of the plugins.

This introduces unnecessary complexiy. For example it reads
mysql.plugins to find all other plugins, causing the hack of moving
spider plugin init to a separate thread.

To install all spider related plugins, install soname ha_spider should
be used instead.

This also fixes spurious rows in mysql.plugin when installing say only
the spider plugin with `plugin-load-add=SPIDER=ha_spider.so`:

select * from mysql.plugin;
name dl
spider_alloc_mem ha_spider.so # should not be here
spider_wrapper_protocols ha_spider.so # should not be here

Adapted from part of the reverted commit
c160a115b8b6dcd54bb3daf1a751ee9c68b7ee47.

d8997f8... by Marko Mäkelä

Merge 10.8 into 10.9

7d96742... by Marko Mäkelä

MDEV-31147 json_normalize does not work correctly with MSAN build

json_normalize_number(): Avoid accessing str past str_len.
The function would seem to work incorrectly when some digits are
not followed by a decimal point (.) or an exponent (E or e).

5028b7c... by Marko Mäkelä

Merge 10.6 into 10.8

4a668c1... by Marko Mäkelä

MDEV-29401 InnoDB history list length increased in 10.6 compared to 10.5

The InnoDB buffer pool and locking were heavily refactored in
MariaDB Server 10.6. Among other things, dict_sys.mutex was removed,
and the contended lock_sys.mutex was replaced with a combination of
lock_sys.latch and distributed latches in hash tables. Also, a
default value was changed to innodb_flush_method=O_DIRECT to improve
performance in write-heavy workloads.

One thing where an adjustment was missing is around the parameters
innodb_max_purge_lag (number of committed transactions waiting to
be purged), and innodb_max_purge_lag_delay
(maximum number of microseconds to delay a DML operation).

purge_coordinator_state::do_purge(): Pass the history_size to trx_purge()
and reset srv_dml_needed_delay if the history is empty.
Keep executing the loop non-stop as long as srv_dml_needed_delay is set.

trx_purge_dml_delay(): Made part of trx_purge().
Set srv_dml_needed_delay=0 when nothing can be purged (!n_pages_handled).

row_mysql_delay_if_needed(): Mimic the logic of
innodb_max_purge_lag_wait_update().

Reviewed by: Thirunarayanan Balathandayuthapani

f272463... by Monty <email address hidden>

Cleanup of MDEV-14974: --port ignored for --host=localhost

The old code added to 10.6 was inconsisting in how TCP/IP and
socket connection was chosen. One got also a confusing warning
in some cases.

Examples:
> ../client/mysql --print-defaults
../client/mysql would have been started with the following arguments:
--socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
> ../client/mysql
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mariadbd.sock' (2)
> ../client/mysql --print-defaults
../client/mysql would have been started with the following arguments:
--socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
> ../client/mysql --port=3333
WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol.
ERROR 2002 (HY000): Can't connect to server on 'localhost' (111)
> ../client/mysql --port=3333 --socket=sss
ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)
> ../client/mysql --socket=sss --port=3333
ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)

Some notable things:
- One gets a warning if one uses just --port if config file sets socket
- Using port and socket gives no warning
- Using socket and then port still uses socket

This patch changes things the following ways:
If --port= is given on the command line, the the protocol is automatically
  changed to "TCP/IP".
- If --socket= is given on the command line, the protocol is automatically
  changed to "socket".
- The last option wins
- No warning is given if protocol changes automatically.

d0a71e9... by Daniel Black

deb: sid - debian autobake

Deb-autobakes where failing with:

dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run exists in debian/tmp but is not installed to anywhere
dh_missing: warning: usr/share/mysql/mysql-test/mtr exists in debian/tmp but is not installed to anywhere
dh_missing: warning: usr/share/mysql/mysql-test/mariadb-test-run exists in debian/tmp but is not installed to anywhere
dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run.pl exists in debian/tmp but is not installed to anywhere

Add all to mariadb-test.install and remove mariadb-test.links