Skip to content

Commit 641f093

Browse files
committed
Merge 10.5 into 10.6
2 parents f43370b + 82d5994 commit 641f093

37 files changed

+123
-96
lines changed

debian/salsa-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,8 @@ mariadb.org-10.2 to mariadb-10.6 upgrade:
732732
# prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3
733733
- mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment"
734734
- echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf
735-
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql
736-
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM plugin;" mysql
735+
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost"
736+
- mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM mysql.plugin; SHOW PLUGINS"
737737
- *test-install
738738
- service mysql status
739739
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server

extra/innochecksum.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ FILE* log_file = NULL;
9494
/* Enabled for log write option. */
9595
static bool is_log_enabled = false;
9696

97+
static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX];
98+
const byte *field_ref_zero = field_ref_zero_buf;
99+
97100
#ifndef _WIN32
98101
/* advisory lock for non-window system. */
99102
struct flock lk;

extra/mariabackup/xtrabackup.cc

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4479,6 +4479,14 @@ static bool xtrabackup_backup_func()
44794479
goto fail;
44804480
}
44814481

4482+
4483+
if (auto b = aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096)) {
4484+
field_ref_zero = static_cast<byte*>(
4485+
memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
4486+
} else {
4487+
goto fail;
4488+
}
4489+
44824490
{
44834491
/* definition from recv_recovery_from_checkpoint_start() */
44844492
ulint max_cp_field;
@@ -4493,14 +4501,17 @@ static bool xtrabackup_backup_func()
44934501

44944502
if (err != DB_SUCCESS) {
44954503
msg("Error: cannot read redo log header");
4504+
unlock_and_fail:
44964505
mysql_mutex_unlock(&log_sys.mutex);
4506+
free_and_fail:
4507+
aligned_free(const_cast<byte*>(field_ref_zero));
4508+
field_ref_zero = nullptr;
44974509
goto fail;
44984510
}
44994511

45004512
if (log_sys.log.format == 0) {
45014513
msg("Error: cannot process redo log before MariaDB 10.2.2");
4502-
mysql_mutex_unlock(&log_sys.mutex);
4503-
goto fail;
4514+
goto unlock_and_fail;
45044515
}
45054516

45064517
byte* buf = log_sys.checkpoint_buf;
@@ -4521,7 +4532,7 @@ static bool xtrabackup_backup_func()
45214532
xtrabackup_init_datasinks();
45224533

45234534
if (!select_history()) {
4524-
goto fail;
4535+
goto free_and_fail;
45254536
}
45264537

45274538
/* open the log file */
@@ -4530,12 +4541,13 @@ static bool xtrabackup_backup_func()
45304541
if (dst_log_file == NULL) {
45314542
msg("Error: failed to open the target stream for '%s'.",
45324543
LOG_FILE_NAME);
4533-
goto fail;
4544+
goto free_and_fail;
45344545
}
45354546

45364547
/* label it */
4537-
byte MY_ALIGNED(OS_FILE_LOG_BLOCK_SIZE) log_hdr_buf[LOG_FILE_HDR_SIZE];
4538-
memset(log_hdr_buf, 0, sizeof log_hdr_buf);
4548+
byte* log_hdr_buf = static_cast<byte*>(
4549+
aligned_malloc(LOG_FILE_HDR_SIZE, OS_FILE_LOG_BLOCK_SIZE));
4550+
memset(log_hdr_buf, 0, LOG_FILE_HDR_SIZE);
45394551

45404552
byte *log_hdr_field = log_hdr_buf;
45414553
mach_write_to_4(LOG_HEADER_FORMAT + log_hdr_field, log_sys.log.format);
@@ -4564,11 +4576,13 @@ static bool xtrabackup_backup_func()
45644576
log_block_calc_checksum_crc32(log_hdr_field));
45654577

45664578
/* Write log header*/
4567-
if (ds_write(dst_log_file, log_hdr_buf, sizeof(log_hdr_buf))) {
4579+
if (ds_write(dst_log_file, log_hdr_buf, LOG_FILE_HDR_SIZE)) {
45684580
msg("error: write to logfile failed");
4569-
goto fail;
4581+
aligned_free(log_hdr_buf);
4582+
goto free_and_fail;
45704583
}
45714584

4585+
aligned_free(log_hdr_buf);
45724586
log_copying_running = true;
45734587
/* start io throttle */
45744588
if(xtrabackup_throttle) {
@@ -4586,7 +4600,7 @@ static bool xtrabackup_backup_func()
45864600
" error %s.", ut_strerr(err));
45874601
fail_before_log_copying_thread_start:
45884602
log_copying_running = false;
4589-
goto fail;
4603+
goto free_and_fail;
45904604
}
45914605

45924606
/* copy log file by current position */
@@ -4609,7 +4623,7 @@ static bool xtrabackup_backup_func()
46094623

46104624
/* FLUSH CHANGED_PAGE_BITMAPS call */
46114625
if (!flush_changed_page_bitmaps()) {
4612-
goto fail;
4626+
goto free_and_fail;
46134627
}
46144628

46154629
ut_a(xtrabackup_parallel > 0);
@@ -4677,6 +4691,9 @@ static bool xtrabackup_backup_func()
46774691
if (opt_log_innodb_page_corruption)
46784692
ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE);
46794693

4694+
aligned_free(const_cast<byte*>(field_ref_zero));
4695+
field_ref_zero = nullptr;
4696+
46804697
if (!ok) {
46814698
goto fail;
46824699
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
22
--default-storage-engine=MyISAM
33
--loose-skip-innodb-file-per-table
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
1+
--loose-skip-stack-trace --log-warnings=0 --log-bin=master-bin --log-bin-index=master-bin
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004
1+
--loose-skip-stack-trace --skip-core-file --loose-debug-dbug=+d,xa_recover_expect_master_bin_000004
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--binlog-optimize-thread-scheduling=0 --skip-stack-trace --skip-core-file
1+
--binlog-optimize-thread-scheduling=0 --loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--binlog-optimize-thread-scheduling=0 --skip-stack-trace --skip-core-file
1+
--binlog-optimize-thread-scheduling=0 --loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
--innodb_file_per_table=1
2-
--skip-stack-trace
2+
--loose-skip-stack-trace
33
--skip-core-file
44
--loose-innodb_buffer_pool_load_at_startup=OFF
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
22
--default-storage-engine=Aria
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
1+
--loose-skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --max_allowed_packet=32000000
1+
--loose-skip-stack-trace --skip-core-file --max_allowed_packet=32000000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
1+
--loose-skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover-options=
1+
--loose-skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover-options=
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
1+
--loose-skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
1+
--loose-innodb-file-per-table=1 --loose-skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --myisam-recover-options=off
1+
--loose-skip-stack-trace --skip-core-file --myisam-recover-options=off
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
1+
--loose-innodb-file-per-table=1 --loose-skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file --skip-innodb
1+
--loose-skip-stack-trace --skip-core-file --skip-innodb
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--skip-stack-trace --skip-core-file
1+
--loose-skip-stack-trace --skip-core-file

mysys/crc32/crc32_arm64.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#include <string.h>
33
#include <stdint.h>
44

5+
static int pmull_supported;
6+
57
#if defined(HAVE_ARMV8_CRC)
68

79
#if defined(__APPLE__)
810
#include <sys/sysctl.h>
911

10-
static int pmull_supported;
11-
1212
int crc32_aarch64_available(void)
1313
{
1414
int ret;
@@ -48,8 +48,6 @@ static unsigned long getauxval(unsigned int key)
4848
# define HWCAP_PMULL (1 << 4)
4949
#endif
5050

51-
static int pmull_supported;
52-
5351
/* ARM made crc32 default from ARMv8.1 but optional in ARMv8A
5452
* Runtime check API.
5553
*/

storage/innobase/buf/buf0buf.cc

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ constexpr ulint BUF_PAGE_READ_MAX_RETRIES= 100;
318318
read-ahead buffer. (Divide buf_pool size by this amount) */
319319
constexpr uint32_t BUF_READ_AHEAD_PORTION= 32;
320320

321+
/** A 64KiB buffer of NUL bytes, for use in assertions and checks,
322+
and dummy default values of instantly dropped columns.
323+
Initially, BLOB field references are set to NUL bytes, in
324+
dtuple_convert_big_rec(). */
325+
const byte *field_ref_zero;
326+
321327
/** The InnoDB buffer pool */
322328
buf_pool_t buf_pool;
323329
buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_reg;
@@ -571,7 +577,7 @@ static void buf_page_check_lsn(bool check_lsn, const byte* read_buf)
571577
@return whether the buffer is all zeroes */
572578
bool buf_is_zeroes(span<const byte> buf)
573579
{
574-
ut_ad(buf.size() <= sizeof field_ref_zero);
580+
ut_ad(buf.size() <= UNIV_PAGE_SIZE_MAX);
575581
return memcmp(buf.data(), field_ref_zero, buf.size()) == 0;
576582
}
577583

@@ -1151,11 +1157,17 @@ bool buf_pool_t::create()
11511157
ut_ad(srv_buf_pool_size % srv_buf_pool_chunk_unit == 0);
11521158
ut_ad(!is_initialised());
11531159
ut_ad(srv_buf_pool_size > 0);
1160+
ut_ad(!resizing);
1161+
ut_ad(!chunks_old);
1162+
ut_ad(!field_ref_zero);
11541163

11551164
NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE;
11561165

1157-
ut_ad(!resizing);
1158-
ut_ad(!chunks_old);
1166+
if (auto b= aligned_malloc(UNIV_PAGE_SIZE_MAX, 4096))
1167+
field_ref_zero= static_cast<const byte*>
1168+
(memset_aligned<4096>(b, 0, UNIV_PAGE_SIZE_MAX));
1169+
else
1170+
return true;
11591171

11601172
chunk_t::map_reg= UT_NEW_NOKEY(chunk_t::map());
11611173

@@ -1186,6 +1198,8 @@ bool buf_pool_t::create()
11861198
chunks= nullptr;
11871199
UT_DELETE(chunk_t::map_reg);
11881200
chunk_t::map_reg= nullptr;
1201+
aligned_free(const_cast<byte*>(field_ref_zero));
1202+
field_ref_zero= nullptr;
11891203
ut_ad(!is_initialised());
11901204
return true;
11911205
}
@@ -1301,6 +1315,8 @@ void buf_pool_t::close()
13011315
io_buf.close();
13021316
UT_DELETE(chunk_t::map_reg);
13031317
chunk_t::map_reg= chunk_t::map_ref= nullptr;
1318+
aligned_free(const_cast<byte*>(field_ref_zero));
1319+
field_ref_zero= nullptr;
13041320
}
13051321

13061322
/** Try to reallocate a control block.
@@ -1326,6 +1342,7 @@ inline bool buf_pool_t::realloc(buf_block_t *block)
13261342
if (block->page.can_relocate()) {
13271343
memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(
13281344
new_block->frame, block->frame, srv_page_size);
1345+
mysql_mutex_lock(&buf_pool.flush_list_mutex);
13291346
new (&new_block->page) buf_page_t(block->page);
13301347

13311348
/* relocate LRU list */
@@ -1385,6 +1402,7 @@ inline bool buf_pool_t::realloc(buf_block_t *block)
13851402
buf_flush_relocate_on_flush_list(&block->page,
13861403
&new_block->page);
13871404
}
1405+
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
13881406
block->page.set_corrupt_id();
13891407

13901408
/* set other flags of buf_block_t */
@@ -2780,12 +2798,14 @@ buf_page_get_low(
27802798
/* Note: this is the uncompressed block and it is not
27812799
accessible by other threads yet because it is not in
27822800
any list or hash table */
2801+
mysql_mutex_lock(&buf_pool.flush_list_mutex);
27832802
buf_relocate(bpage, &block->page);
27842803

27852804
/* Set after buf_relocate(). */
27862805
block->page.set_buf_fix_count(1);
27872806

27882807
buf_flush_relocate_on_flush_list(bpage, &block->page);
2808+
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
27892809

27902810
/* Buffer-fix, I/O-fix, and X-latch the block
27912811
for the duration of the decompression.
@@ -3243,8 +3263,10 @@ static buf_block_t* buf_page_create_low(page_id_t page_id, ulint zip_size,
32433263
}
32443264

32453265
free_block->lock.x_lock();
3266+
mysql_mutex_lock(&buf_pool.flush_list_mutex);
32463267
buf_relocate(&block->page, &free_block->page);
32473268
buf_flush_relocate_on_flush_list(&block->page, &free_block->page);
3269+
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
32483270

32493271
free_block->page.set_state(BUF_BLOCK_FILE_PAGE);
32503272
buf_unzip_LRU_add_block(free_block, FALSE);

storage/innobase/buf/buf0flu.cc

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -289,43 +289,29 @@ buf_flush_relocate_on_flush_list(
289289
{
290290
buf_page_t* prev;
291291

292-
mysql_mutex_assert_owner(&buf_pool.mutex);
292+
mysql_mutex_assert_owner(&buf_pool.flush_list_mutex);
293293
ut_ad(!fsp_is_system_temporary(bpage->id().space()));
294294

295-
const lsn_t lsn = bpage->oldest_modification_acquire();
295+
const lsn_t lsn = bpage->oldest_modification();
296296

297297
if (!lsn) {
298298
return;
299299
}
300300

301301
ut_ad(lsn == 1 || lsn > 2);
302-
303-
mysql_mutex_lock(&buf_pool.flush_list_mutex);
304-
305-
/* FIXME: Can we avoid holding buf_pool.mutex here? */
306302
ut_ad(dpage->oldest_modification() == lsn);
307303

308-
if (ut_d(const lsn_t o_lsn =) bpage->oldest_modification()) {
309-
ut_ad(o_lsn == lsn);
304+
/* Important that we adjust the hazard pointer before removing
305+
the bpage from the flush list. */
306+
buf_pool.flush_hp.adjust(bpage);
310307

311-
/* Important that we adjust the hazard pointer before removing
312-
the bpage from the flush list. */
313-
buf_pool.flush_hp.adjust(bpage);
308+
prev = UT_LIST_GET_PREV(list, bpage);
309+
UT_LIST_REMOVE(buf_pool.flush_list, bpage);
314310

315-
prev = UT_LIST_GET_PREV(list, bpage);
316-
UT_LIST_REMOVE(buf_pool.flush_list, bpage);
317-
318-
bpage->clear_oldest_modification();
319-
} else {
320-
/* bpage was removed from buf_pool.flush_list
321-
since we last checked, and before we acquired
322-
buf_pool.flush_list_mutex. */
323-
goto was_clean;
324-
}
311+
bpage->clear_oldest_modification();
325312

326313
if (lsn == 1) {
327314
buf_pool.stat.flush_list_bytes -= dpage->physical_size();
328-
was_clean:
329315
dpage->list.prev = nullptr;
330316
dpage->list.next = nullptr;
331317
dpage->clear_oldest_modification();
@@ -337,7 +323,6 @@ buf_flush_relocate_on_flush_list(
337323
}
338324

339325
ut_d(buf_flush_validate_low());
340-
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
341326
}
342327

343328
/** Complete write of a file page from buf_pool.

0 commit comments

Comments
 (0)