Commit graph

197929 commits

Author SHA1 Message Date
Robin Newhouse
03d4fd3214 Backport GitLab CI to 10.5
Add .gitlab-ci.yml file to earliest supported branch to enable
automated building and testing for all MariaDB major branches.

Note to mergers:
GitLab CI is available for branches >= 10.6. This commit includes a
GitLab CI file identical to that in branches >= 10.6, except for the
MARIADB_MAJOR_VERSION variable which should reflect the branch version.
A modified CI will be included in branches 10.4 with PR !2418.
Also changed is the `allow_failure: true` for the MSAN build,
which should be merged up to later branches.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer
Amazon Web Services, Inc.
2023-05-19 16:25:47 +01:00
Marko Mäkelä
d2420669bd MDEV-31309 Innodb_buffer_pool_read_requests is not updated correctly
srv_export_innodb_status(): Update
export_vars.innodb_buffer_pool_read_requests as it was done
before commit a55b951e60 (MDEV-26827).
If innodb_status_variables[] pointed to a sharded variable, it would
only access the first shard.
2023-05-19 15:38:48 +03:00
Marko Mäkelä
df524dc06f MDEV-31308 InnoDB monitor trx_rseg_history_len was accidentally disabled by default
innodb_counter_info[]: Revert a change that was accidentally made in
commit 204e7225dc
2023-05-19 15:29:26 +03:00
Marko Mäkelä
f2c17cc9d9 MDEV-29911 InnoDB recovery and mariadb-backup --prepare fail to report detailed progress
This is a 10.6 port of commit 2f9e264781
from MariaDB Server 10.9 that is missing some optimization due to a
more complex redo log format and recovery logic
(which was simplified in commit 685d958e38).

The progress reporting of InnoDB crash recovery was rather intermittent.
Nothing was reported during the single-threaded log record parsing, which
could consume minutes when parsing a large log. During log application,
there only was progress reporting in background threads that would be
invoked on data page read completion.

The progress reporting here will be detailed like this:

InnoDB: Starting crash recovery from checkpoint LSN=628599973,5653727799
InnoDB: Read redo log up to LSN=1963895808
InnoDB: Multi-batch recovery needed at LSN 2534560930
InnoDB: Read redo log up to LSN=3312233472
InnoDB: Read redo log up to LSN=1599646720
InnoDB: Read redo log up to LSN=2160831488
InnoDB: To recover: LSN 2806789376/2806819840; 195082 pages
InnoDB: To recover: LSN 2806789376/2806819840; 63507 pages
InnoDB: Read redo log up to LSN=3195776000
InnoDB: Read redo log up to LSN=3687099392
InnoDB: Read redo log up to LSN=4165315584
InnoDB: To recover: LSN 4374395699/4374440960; 241454 pages
InnoDB: To recover: LSN 4374395699/4374440960; 123701 pages
InnoDB: Read redo log up to LSN=4508724224
InnoDB: Read redo log up to LSN=5094550528
InnoDB: To recover: 205230 pages

The previous messages "Starting a batch to recover" or
"Starting a final batch to recover" will be replaced by
"To recover: ... pages" messages.

If a batch lasts longer than 15 seconds, then there will be
progress reports every 15 seconds, showing the number of remaining pages.
For the non-final batch, the "To recover:" message includes two end LSN:
that of the batch, and of the recovered log. This is the primary measure
of progress. The batch will end once the number of pages to recover
reaches 0.

If recovery is possible in a single batch, the output will look like this,
with a shorter "To recover:" message that counts only the remaining pages:

InnoDB: Starting crash recovery from checkpoint LSN=628599973,5653727799
InnoDB: Read redo log up to LSN=1984539648
InnoDB: Read redo log up to LSN=2710875136
InnoDB: Read redo log up to LSN=3358895104
InnoDB: Read redo log up to LSN=3965299712
InnoDB: Read redo log up to LSN=4557417472
InnoDB: Read redo log up to LSN=5219527680
InnoDB: To recover: 450915 pages

We will also speed up recovery by improving the memory management and
implementing multi-threaded recovery of data pages that will not need
to be read into the buffer pool ("fake read"). Log application in the
"fake read" threads will be protected by an atomic being_recovered field
and exclusive buf_page_t::lock.

Recovery will reserve for data pages two thirds of the buffer pool,
or 256 pages, whichever is smaller. Previously, we could only use at most
one third of the buffer pool for buffered log records. This would typically
mean that with large buffer pools, recovery unnecessary consisted of
multiple batches.

If recovery runs out of memory, it will "roll back" or "rewind" the current
mini-transaction. The recv_sys.recovered_lsn and recv_sys.pages
will correspond to the "out of memory LSN", at the end of the previous
complete mini-transaction.

If recovery runs out of memory while executing the final recovery batch,
we can simply invoke recv_sys.apply(false) to make room, and resume
parsing.

If recovery runs out of memory before the final batch, we will
scan the redo log to the end and check for any missing or inconsistent
files. In this version of the patch, we will throw away any previously
buffered recv_sys.pages and rescan the log from the checkpoint onwards.

recv_sys_t::pages_it: A cached iterator to recv_sys.pages.

recv_sys_t::is_memory_exhausted(): Remove. We will have out-of-memory
handling deep inside recv_sys_t::parse().

recv_sys_t::rewind(), page_recv_t::recs_t::rewind():
Remove all log starting with a specific LSN.

IORequest::write_complete(), IORequest::read_complete():
Replaces fil_aio_callback().

read_io_callback(), write_io_callback(): Replaces io_callback().

IORequest::fake_read_complete(), fake_io_callback(), os_fake_read():
Process a "fake read" request for concurrent recovery.

recv_sys_t::apply_batch(): Choose a number of successive pages
for a recovery batch.

recv_sys_t::erase(recv_sys_t::map::iterator): Remove log records for a
page whose recovery is not in progress. Log application threads
will not invoke this; they will only set being_recovered=-1 to indicate
that the entry is no longer needed.

recv_sys_t::garbage_collect(): Remove all being_recovered=-1 entries.

recv_sys_t::wait_for_pool(): Wait for some space to become available
in the buffer pool.

mlog_init_t::mark_ibuf_exist(): Avoid calls to
recv_sys::recover_low() via ibuf_page_exists() and buf_page_get_low().
Such calls would lead to double locking of recv_sys.mutex, which
depending on implementation could cause a deadlock. We will use
lower-level calls to look up index pages.

buf_LRU_block_remove_hashed(): Disable consistency checks for freed
ROW_FORMAT=COMPRESSED pages. Their contents could be uninitialized garbage.
This fixes an occasional failure of the test
innodb.innodb_bulk_create_index_debug.

Tested by: Matthias Leich
2023-05-19 15:20:07 +03:00
Marko Mäkelä
2f9e264781 MDEV-29911 InnoDB recovery and mariadb-backup --prepare fail to report detailed progress
The progress reporting of InnoDB crash recovery was rather intermittent.
Nothing was reported during the single-threaded log record parsing, which
could consume minutes when parsing a large log. During log application,
there only was progress reporting in background threads that would be
invoked on data page read completion.

The progress reporting here will be detailed like this:

InnoDB: Starting crash recovery from checkpoint LSN=503549688
InnoDB: Parsed redo log up to LSN=1990840177; to recover: 124806 pages
InnoDB: Parsed redo log up to LSN=2729777071; to recover: 186123 pages
InnoDB: Parsed redo log up to LSN=3488599173; to recover: 248397 pages
InnoDB: Parsed redo log up to LSN=4177856618; to recover: 306469 pages
InnoDB: Multi-batch recovery needed at LSN 4189599815
InnoDB: End of log at LSN=4483551634
InnoDB: To recover: LSN 4189599815/4483551634; 307490 pages
InnoDB: To recover: LSN 4189599815/4483551634; 197159 pages
InnoDB: To recover: LSN 4189599815/4483551634; 67623 pages
InnoDB: Parsed redo log up to LSN=4353924218; to recover: 102083 pages
...
InnoDB: log sequence number 4483551634 ...

The previous messages "Starting a batch to recover" or
"Starting a final batch to recover" will be replaced by
"To recover: ... pages" messages.

If a batch lasts longer than 15 seconds, then there will be
progress reports every 15 seconds, showing the number of remaining pages.
For the non-final batch, the "To recover:" message includes two end LSN:
that of the batch, and of the recovered log. This is the primary measure
of progress. The batch will end once the number of pages to recover
reaches 0.

If recovery is possible in a single batch, the output will look like this,
with a shorter "To recover:" message that counts only the remaining pages:

InnoDB: Starting crash recovery from checkpoint LSN=503549688
InnoDB: Parsed redo log up to LSN=1998701027; to recover: 125560 pages
InnoDB: Parsed redo log up to LSN=2734136874; to recover: 186446 pages
InnoDB: Parsed redo log up to LSN=3499505504; to recover: 249378 pages
InnoDB: Parsed redo log up to LSN=4183247844; to recover: 306964 pages
InnoDB: End of log at LSN=4483551634
...
InnoDB: To recover: 331797 pages
...
InnoDB: log sequence number 4483551634 ...

We will also speed up recovery by improving the memory management and
implementing multi-threaded recovery of data pages that will not need
to be read into the buffer pool ("fake read"). Log application in the
"fake read" threads will be protected by an atomic being_recovered field
and exclusive buf_page_t::latch.

Recovery will reserve for data pages two thirds of the buffer pool,
or 256 pages, whichever is smaller. Previously, we could only use at most
one third of the buffer pool for buffered log records. This would typically
mean that with large buffer pools, recovery unnecessary consisted of
multiple batches.

If recovery runs out of memory, it will "roll back" or "rewind" the current
mini-transaction. The recv_sys.lsn and recv_sys.pages will correspond
to the "out of memory LSN", at the end of the previous complete
mini-transaction.

If recovery runs out of memory while executing the final recovery batch,
we can simply invoke recv_sys.apply(false) to make room, and resume
parsing.

If recovery runs out of memory before the final batch, we will scan
the redo log to the end (recv_sys.scanned_lsn) and check for any missing
or inconsistent files. If recv_init_crash_recovery_spaces() does not
report any potentially missing tablespaces, we can make use of the
already stored recv_sys.pages and only rewind to the "out of memory LSN".
Else, we must keep parsing and invoking recv_validate_tablespace()
until an error has been found or everything has been resolved, and
ultimatily rewind to to the checkpoint LSN.

recv_sys_t::pages_it: A cached iterator to recv_sys.pages

recv_sys_t::parse_mtr(): Remove an ATTRIBUTE_NOINLINE that would
prevent tail call optimization in recv_sys_t::parse_pmem().

recv_sys_t::parse(), recv_sys_t::parse_mtr(), recv_sys_t::parse_pmem():
Add template<bool store> parameter. Redo log record parsing
(store=false) is better specialized from store=true
(with bool if_exists) so that we can avoid some conditional branches
in frequently invoked low-level code.

recv_sys_t::is_memory_exhausted(): Remove. The special parse() status
GOT_OOM will report out-of-memory situation at the low level.

recv_sys_t::rewind(), page_recv_t::recs_t::rewind():
Remove all log starting with a specific LSN.

recv_scan_log(): Separate some code for only parsing, not storing log.
In rewound_lsn, remember the LSN at which last_phase=false recovery
ran out of memory. This is where the next call to recv_scan_log()
will resume storing the log. This replaces recv_sys.last_stored_lsn.

recv_sys_t::parse(): Evaluate the template parameter store in a few more
cases, to allow dead code to be eliminated at compile time.

recv_sys_t::scanned_lsn: The end of the log found by recv_scan_log().
The special value 1 means that recv_sys has been initialized but
no log has been parsed.

IORequest::write_complete(), IORequest::read_complete():
Replaces fil_aio_callback().

read_io_callback(), write_io_callback(): Replaces io_callback().

IORequest::fake_read_complete(), fake_io_callback(), os_fake_read():
Process a "fake read" request for concurrent recovery.

recv_sys_t::apply_batch(): Choose a number of successive pages
for a recovery batch.

recv_sys_t::erase(recv_sys_t::map::iterator): Remove log records for a
page whose recovery is not in progress. Log application threads
will not invoke this; they will only set being_recovered=-1 to indicate
that the entry is no longer needed.

recv_sys_t::garbage_collect(): Remove all being_recovered=-1 entries.

recv_sys_t::wait_for_pool(): Wait for some space to become available
in the buffer pool.

mlog_init_t::mark_ibuf_exist(): Avoid calls to
recv_sys::recover_low() via ibuf_page_exists() and buf_page_get_low().
Such calls would lead to double locking of recv_sys.mutex, which
depending on implementation could cause a deadlock. We will use
lower-level calls to look up index pages.

buf_LRU_block_remove_hashed(): Disable consistency checks for freed
ROW_FORMAT=COMPRESSED pages. Their contents could be uninitialized garbage.
This fixes an occasional failure of the test
innodb.innodb_bulk_create_index_debug.

Tested by: Matthias Leich
2023-05-19 15:15:38 +03:00
Marko Mäkelä
2ec42f793d Merge 10.6 into 10.9 2023-05-19 15:11:06 +03:00
Vlad Lesin
5422784792 MDEV-31256 fil_node_open_file() releases fil_system.mutex allowing other thread to open its file node
There is room between mutex_exit(&fil_system.mutex) and
mutex_enter(&fil_system.mutex) calls in fil_node_open_file(). During this
room another thread can open the node, and ut_ad(!node->is_open())
assertion in fil_node_open_file_low() can fail.

The fix is not to open node if it was already opened by another thread.
2023-05-19 14:52:47 +03:00
Marko Mäkelä
1fe830b56a Merge 10.5 into 10.6 2023-05-19 14:24:09 +03:00
Marko Mäkelä
347e22fbf8 Merge bb-10.6-release into 10.6 2023-05-19 14:23:53 +03:00
Marko Mäkelä
06d555a41a Merge bb-10.5-release into 10.5 2023-05-19 14:23:04 +03:00
Marko Mäkelä
e5933b99d5 MDEV-31234 related cleanup
trx_purge_free_segment(), trx_purge_truncate_rseg_history():
Replace some unreachable code with debug assertions.
A buffer-fix does prevent pages from being evicted
from the buffer pool; see buf_page_t::can_relocate().

Tested by: Matthias Leich
2023-05-19 12:25:30 +03:00
Marko Mäkelä
37492960f3 Merge 10.5 into 10.6 2023-05-19 12:24:58 +03:00
Marko Mäkelä
e0084b9d31 MDEV-31234 InnoDB does not free UNDO after the fix of MDEV-30671
trx_purge_truncate_history(): Only call trx_purge_truncate_rseg_history()
if the rollback segment is safe to process. This will avoid leaking undo
log pages that are not yet ready to be processed. This fixes a regression
that was introduced in
commit 0de3be8cfd (MDEV-30671).

trx_sys_t::any_active_transactions(): Separately count XA PREPARE
transactions.

srv_purge_should_exit(): Terminate slow shutdown if the history size
does not change and XA PREPARE transactions exist in the system.
This will avoid a hang of the test innodb.recovery_shutdown.

Tested by: Matthias Leich
2023-05-19 12:19:26 +03:00
Otto Kekäläinen
caeff13579 Remove CODEOWNERS as obsolete
The CODEOWNERS was added almost 3 years ago but never saw any adoption.
Only one person used it (me) to mark what files I maintain and for which
I wish to review commits. No other maintainers or code paths were added,
so clean it away for clarity.
2023-05-17 19:46:59 -07:00
Rucha Deodhar
3b34454c9d MDEV-23187: Assorted assertion failures in json_find_path with certain
collations

Analysis:
When we have negative index, the value in array_counter[] array is going to
be -1 at some point ( because in case of negative index in json path, the
initial value for a path with negative index is -<size_of_array>, and as we
move forward in array while parsing it and finding path, this value
increments). Since SKIPPED_STEP_MARK, is maximum uint value, it gets
compared to some int value in the array and eventually equates to -1
and messes with path.
Fix:
Make SKIPPED_STEP_MARK maximum of INT32.
2023-05-15 12:17:30 +05:30
Marko Mäkelä
a3e5b5c4db Merge 10.5 into 10.6 2023-05-15 09:02:32 +03:00
Tuukka Pasanen
f522b0f230 MDEV-30951: Fix small perlcritic and enable modern Perl
Add Modern Perl headers. Perl 5.16 is still fairly
old from 2012.

Enable UTF-8, warnings and make script 'strict'

Small fixes for perlcritic reported problems and some crashes

I/O layer ":utf8" used at line 268, column 16.  Use ":encoding(UTF-8)" to get strict validation.  (Severity: 5)
"return" statement with explicit "undef" at line 806, column 4.  See page 199 of PBP.  (Severity: 5)
"return" statement with explicit "undef" at line 6844, column 4.  See page 199 of PBP.  (Severity: 5)
"return" statement with explicit "undef" at line 7524, column 4.  See page 199 of PBP.  (Severity: 5)
"return" statement with explicit "undef" at line 7527, column 4.  See page 199 of PBP.  (Severity: 5)
"return" statement with explicit "undef" at line 7599, column 4.  See page 199 of PBP.  (Severity: 5)
"return" statement with explicit "undef" at line 7602, column 4.  See page 199 of PBP.  (Severity: 5)
Expression form of "eval" at line 7784, column 4.  See page 161 of PBP.  (Severity: 5)
Expression form of "eval" at line 7806, column 4.  See page 161 of PBP.  (Severity: 5)
Glob written as <...> at line 8016, column 25.  See page 167 of PBP.  (Severity: 5)
"return" statement followed by "sort" at line 9195, column 60.  Behavior is undefined if called in scalar context.  (Severity: 5)
Expression form of "eval" at line 9846, column 10.  See page 161 of PBP.  (Severity: 5)
2023-05-12 15:17:40 +01:00
Marko Mäkelä
c9eff1a144 MDEV-31254 InnoDB: Trying to read doublewrite buffer page
buf_read_page_low(): Remove an error message and a debug assertion
that can be triggered when using innodb_page_size=4k and
innodb_file_per_table=0. In that case, buf_read_ahead_linear()
may be invoked on page 255, which is one less than the first
page of the doublewrite buffer (256).
2023-05-12 15:04:50 +03:00
Marko Mäkelä
477285c8ea MDEV-31253 Freed data pages are not always being scrubbed
fil_space_t::flush_freed(): Renamed from buf_flush_freed_pages();
this is a backport of aa45850687 from 10.6.
Invoke log_write_up_to() on last_freed_lsn, instead of avoiding
the operation when the log has not yet been written.
A more costly alternative would be that log_checkpoint() would invoke
this function on every affected tablespace.
2023-05-12 14:57:14 +03:00
Marko Mäkelä
717e3b3cfd Merge 10.6 into 10.9 2023-05-11 14:27:32 +03:00
Marko Mäkelä
c271057288 Merge 10.5 into 10.6 2023-05-11 13:27:01 +03:00
Marko Mäkelä
279d0120f5 MDEV-29967 innodb_read_ahead_threshold (linear read-ahead) does not work
buf_read_ahead_linear(): Correct some calculations that were broken
in commit b1ab211dee (MDEV-15053).

Thanks to Daniel Black for providing a test case and initial debugging.

Tested by: Matthias Leich
2023-05-11 13:21:57 +03:00
Marko Mäkelä
2763f733ee Merge 10.8 into 10.9 2023-05-11 09:24:59 +03:00
Marko Mäkelä
d4dd634529 MariaDB 10.5.20 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmRbiP0ACgkQ8WVvJMdM
 0di/XQ/8CrgzpJtgCuqXEy5YZgHfRYmgV3GV5IWfzdLDWiHYy6ySBLaXCDCJcIbz
 wjx2jFZcM8S3jzpxIDWYw7g2CWz9DRwYHNVIglsdVW3oM/nariskYqVH04B2Ipjo
 smUkohnh6cqh4ewgxiahuodUU6jv8sE4CgG859nLHFjui9cBL+NDvoOjsUJkftVT
 pbbgwseqdUIyp+3oTTVmw/dJ78DlM4DOgvoMTHUogCxAWkkXGLBgzYSvFEfYuInP
 N4uiKCeRonVXfZX4b9sqAnB49M2t7b2Oe+TKvl2c/eEBDyJTJaqVmFissRqNrCbh
 otytSfLgkIx80WK9gPtcttM6t36yV3pDFI2PkkoqKIil/eXMT112R7rtlzYPylmy
 /R2PdQBE+MuiMbHjcelWEGx5kxdyVRPicgK6KDEl4/zpNP4a6qqxgOfnlzVw/l1R
 62QQVvWg++IVDq1/XEd96+ipVNjdR0ahhBTf5nZDgRihbMCVKSdvQjETDZr2XW3y
 YobxdwQUoeIAIAqV8uVRWUYxA6bFkDuOOO8vK0CJZIl9U836KKSJltmtfpaNdM9K
 cA+AO/6HzkyaOqvuajyTYIA12vDdyVJPrA0zJn57JExVgpof0YBvck9F6nsIJTJR
 A1CZnt7LJ9v7ZxhPCL5w0LEyKxxNWuAS80Uxeb+jzxv5w8Ig64Y=
 =Bc/P
 -----END PGP SIGNATURE-----

Merge mariadb-10.5.20 into 10.5
2023-05-11 09:09:16 +03:00
Marko Mäkelä
967e9e1d47 MariaDB 10.9.6 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmRbiU4ACgkQ8WVvJMdM
 0dgsxg//cYOWlIypbVAa2cScdJQv8VdEZ9Vcjel7L2atRc190pCNtNtYMy/UWXm0
 ZFaWLi41KuBMAQYNvcN+Nn54IGzPlEOgfI726EiC2w/vILqjsrBV+Mzx9n6nCLYT
 sxbyxP+bKkKEy5a0+5tbFT3jpy3N7fRnwagQL83n5nBCFz8ysRubRJ7Rez0to6Nx
 Gwpiaz1W1frEiG7AJanJhEbEhlxlb5FZ7OYH6H4dapxKEeMLOJo4SAm4wGJ3pZXw
 m8jCi5Ev89KqAxFvC+Rwv3C+9LhT9vHzeQZTBQpYTZ2bWv+KevWGdu7rEtZB7KkK
 fW8ifHCGE4pdDXTw2DQTmTPeD3D3tlncp8rz7ASq/7y6DNP9+PN8poWh8B4wrNAD
 JXTBcZumA52MX9U1BXDZfX5E74y2GMzKW/Yk7H4ZvjF0OETSvrDsR9ONb4iS2CRf
 8lZXxv669tOWwZFU6hnJT2nlxK6grtKpqbawVu1rHHpOv5PHTHaIkRwuhocb+AMF
 hgmUADXXR/M/m+NwR9Ds+qVaX3IrUt3MeQ4ySDkV5hH1rWYI4bmMxpixPPpvWY1x
 FysvlpXIKwFJnkolr73AvoxZqS8vrFvi/wpw3zEuT+o5onnKmFrUNVnsVui3GdyQ
 tumOqddPrkFugmEemw+hsWsyR9FcANmZQwwdMpaLA34Fsgu/bg4=
 =juMs
 -----END PGP SIGNATURE-----

Merge mariadb-10.9.6 into 10.9
2023-05-11 09:07:58 +03:00
Marko Mäkelä
1f1eaef0af Merge 10.6 into 10.8 2023-05-11 09:00:27 +03:00
Marko Mäkelä
7d44e2e7ff MariaDB 10.8.8 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmRbiTYACgkQ8WVvJMdM
 0dhyiQ//XpH3LWCepK6Ipu905kZx989uQQCwFPyoZIMENf++QeZRXxlsb+Ei1Yh9
 xPX4+yqvSas6RXiwxDLcZh/liuto11xHHtYG/8HeW6+3avCJVbsBXSkiVc1yBNFw
 uBP6ayOORP+juwngFsHqlObxymcvVgV4QL8ovso1vk34pzXEO9C6aSljrj8d8a3s
 pNhPdQ9+t7Qz4gwgKODne1eCc2jLXLZjfBEAC3csgjhZnDwOJfuBIXDktZTxM2iZ
 ycxU053vjVS9YNCvMU28336DrJYh0vHpLzHU8zwvAS1vnYaoxpaWsCFzArAJP/ru
 ffPugSfcTfA+4Y6cq1/CceN4e2bWCIWfzkd1wOR5QBDSpZTq8tIP8pe+14cgcaVA
 tiOy+6VgT6X5fShPT/w3uHveQpdQmdxE+u+bnu4zRnRJy+kQ6NOCq5Pn/M7gNrbE
 +Q+YUosl/chUUjvHejAbIR36149/Yh0CsS27uQEpnl3huoF6N/TSx5yd5Wyidg0y
 vTI+YoyiCho0SuY/NKB4FYJZxKjFSEgzJVJEBShojmVfbeB8pXP43Eo+JscDZwPz
 96Uo1zZqZMtJuVaW+xUOY2F92ph80BXPsH5WI/qWVrdxa/MprYPo5QUxrzcu3lJp
 z8SjIThSUShc1d0HfsefBeDDvZ9QpWzxRDUuOWdvdVcXnC8g9Xg=
 =TXya
 -----END PGP SIGNATURE-----

Merge mariadb-10.8.8 into 10.8
2023-05-11 08:59:51 +03:00
Marko Mäkelä
7124911a2c MDEV-31158: Potential hang with ROW_FORMAT=COMPRESSED tables
btr_cur_need_opposite_intention(): Check also page_zip_available()
so that we will escalate to exclusive index latch when a non-leaf
page may have to be split further due to ROW_FORMAT=COMPRESSED page
overflow.

Tested by: Matthias Leich
2023-05-11 08:43:00 +03:00
Marko Mäkelä
38ed782f55 MDEV-30812 fixup: GCC 12.2.0 -Wmaybe-uninitialized
best_access_path(): Simplify the logic for computing fanout.
This fixes up commit 4329ec5d3b
2023-05-11 08:42:28 +03:00
Marko Mäkelä
522a52498c MariaDB 10.6.13 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmRbiR8ACgkQ8WVvJMdM
 0dhnrg/9FuuVtxaqlWqAkrtwrwlw3EVCavG96lXwVvgxAKhv6yIXbNgLPWGuAq6d
 AOnVnsIdcyc63zt/3NQ2ZFTLlKzeoIjExL3W/73Hiz2NT4a+/gbGkCRcz4nMUQG/
 H7B5FXnDdedJ/ZngOl/weBkUo4JGVCLxxFSbzzeLIIegbuyxOZ9pM8bZtDzrdS1C
 N0t2uxOogo+OAw89/nsqIEHLqwZbW1PlLJhhCV1lgYicwVRFo9sECd5yY97/SHhz
 YgoUn1rEniHi7J857kEYIpmtasu42QdgaDiq3zOSER9tGV0sjV56IBWuh6e2YKfM
 Ul93SVH9Y4m5WiMNQf5YbeFMfQGy2drxzQ+eYUkuEMS4iR93rbC4ULtU0Rhhv5Vg
 RSpjuaEITNj2w90S/k+YbjaCXaX0UDadStD4Bw1lFxMCeKDqx5gCsnodv05V3F/d
 YWkpuho/GCxS5CMOCow9KRrMnvFi3SdIyN8gQT8/bFKTo1jUB5kK3DZVi72mRFyF
 mWgVL9JIfZTDPpd0i6WReEIDWe/hHyFVbbNKbf0J4Nrz5kINNX+BEcY+1g7RBhVF
 /kA5GWaEAtgQKDbE/0nTh+iGo/5IMA1CDlkdi5PLHIUGV3dLgDp5Pv0ppxJ2Oq1p
 HX577HZoFOVkErRZBE92Hg9RMEf34gKn8GFK/usVWX5KkC6PDG0=
 =SOjM
 -----END PGP SIGNATURE-----

Merge mariadb-10.6.13 into 10.6
2023-05-11 08:41:23 +03:00
Daniel Bartholomew
56aa73a3e3
bump the VERSION 2023-05-10 08:46:44 -04:00
Daniel Bartholomew
afe44ef212
bump the VERSION 2023-05-10 08:45:08 -04:00
Daniel Bartholomew
0d8b0493ee
bump the VERSION 2023-05-10 08:43:49 -04:00
Tuukka Pasanen
2740b657ce MDEV-31216: Make sure that lsof does not fail on install
Command lsof can fail on Debian install.
Revert logic more like old one to make sure that there is no failing
and still does don't boundce on shellcheck.
2023-05-09 08:55:05 +10:00
Tuukka Pasanen
50cdf0b5ea MDEV-30952: Reformat Debian pre- and postscripts if-clauses
Debian install scripts if-clauses are not formatted
as they should be. This commit formats Debian
Pre and Post script if-clauses.
2023-05-08 16:52:27 +10:00
Tuukka Pasanen
8febdfa342 MDEV-30952: Fix shellcheck problems on Debian scripts
Commit fixes several ShellCheck found problems in Debian
Pre- and Postscripts.

Debian script mariadb-server-10.6.postrm contains shellcheck
Fixed problems are:
  https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q...
  https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf...

Debian script mariadb-server-10.6.postinst contains shellcheck
Fixed problems are:
  https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>...
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf...
  https://www.shellcheck.net/wiki/SC1072 -- Expected test to end here (don't ...
  https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi...
  https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in...

Debian script mariadb-server-10.6.preinst contains shellcheck
Fixed problems are:
  https://www.shellcheck.net/wiki/SC2231 -- Quote expansions in this for loop...
  https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q...
  https://www.shellcheck.net/wiki/SC2001 -- See if you can use ${variable//se...
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf...
  https://www.shellcheck.net/wiki/SC1007 -- Remove space after = if trying to...
2023-05-08 16:52:27 +10:00
Tuukka Pasanen
7cbb45d1d4 MDEV-30952: Reformat Debian post and pre scripts
There is several misindentation inside Debian post and pre
installation scripts. False indentation with space
as indent space should be 2 and indentation with tabs.
2023-05-08 16:52:27 +10:00
Oleksandr Byelkin
3476240129 Merge branch '10.8' into 10.9 2023-05-05 14:01:40 +02:00
Oleksandr Byelkin
2668d596d1 Merge branch '10.6' into 10.8 2023-05-05 13:35:13 +02:00
Sergei Petrunia
a24f2bb50b MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
Derived table creation code would call Field::make_new_field() which would
memcpy the Field object from the source table, including Field::read_stats.

But the temp. table as a whole had table->stats_is_read=false. Which was
correct but not consistent with Field::read_stats and caused an assertion.

Fixed by making sure that Field::read_stats=NULL for fields in the new
temporary (i.e. work) tables.
2023-05-05 13:55:42 +03:00
Oleksandr Byelkin
2871a05ccd Merge branch '10.8' into 10.9 2023-05-05 11:21:37 +02:00
Oleksandr Byelkin
5f5f743d56 Merge branch '10.6' into 10.8 2023-05-05 11:14:33 +02:00
Oleksandr Byelkin
1c39479598 Merge branch '10.5' into 10.6 2023-05-05 11:09:46 +02:00
Oleksandr Byelkin
b735ca4773 Merge branch '10.4' into 10.5 2023-05-05 10:50:02 +02:00
Sergei Petrunia
2594da7a33 MDEV-31194: Server crash or assertion failure with join_cache_level=4
The problem, introduced in patch for MDEV-26301:

When check_join_cache_usage() decides not to use join buffer, it must
adjust the access method accordingly. For BNL-H joins this means switching
from pseudo-"ref access"(with index=MAX_KEY) to some other access method.

Failing to do this will cause assertions down the line when code that is
not aware of BNL-H will try to initialize index use for ref access with
index=MAX_KEY.

The fix is to follow the regular code path to disable the join buffer for
the join_tab ("goto no_join_cache") instead of just returning from
check_join_cache_usage().
2023-05-05 11:16:23 +03:00
Oleksandr Byelkin
84a72f47fc Merge branch '10.8' into 10.9 2023-05-04 19:43:39 +02:00
Oleksandr Byelkin
4ccc310d0e Merge branch '10.6' into 10.8 2023-05-04 19:13:56 +02:00
Oleksandr Byelkin
db3342b325 Merge branch '10.5' into 10.6 2023-05-04 18:47:11 +02:00
Oleksandr Byelkin
ba0433dc1c Merge branch '10.4' into 10.5 2023-05-04 18:19:47 +02:00
Oleksandr Byelkin
7973ffde0f MDEV-31189 Server crash or assertion failure in upon 2nd execution of PS with views and HAVING
Do not try to decide merge/materialize for derived if it was already decided
(even if it is a view).
2023-05-04 17:51:27 +02:00