mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@@ -53,9 +53,14 @@ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
|
|||||||
ALTER TABLE t2 REMOVE PARTITIONING;
|
ALTER TABLE t2 REMOVE PARTITIONING;
|
||||||
connection default;
|
connection default;
|
||||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
||||||
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
|
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter WAIT_FOR mtr_continue';
|
||||||
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
|
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
|
||||||
DROP TABLE IF EXISTS t2;
|
DROP TABLE IF EXISTS t2;
|
||||||
|
# Create a new connection thread to orchestrate the ALTER and DROP
|
||||||
|
# threads' DEBUG_SYNC points to avoid lost signals
|
||||||
|
connect con2,localhost,root,,;
|
||||||
|
SET DEBUG_SYNC= 'now SIGNAL mtr_continue';
|
||||||
|
connection default;
|
||||||
connection con1;
|
connection con1;
|
||||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||||
SET DEBUG_SYNC= 'RESET';
|
SET DEBUG_SYNC= 'RESET';
|
||||||
|
@@ -66,12 +66,27 @@ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
|
|||||||
--send ALTER TABLE t2 REMOVE PARTITIONING
|
--send ALTER TABLE t2 REMOVE PARTITIONING
|
||||||
connection default;
|
connection default;
|
||||||
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
|
||||||
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
|
|
||||||
|
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter WAIT_FOR mtr_continue';
|
||||||
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
|
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
|
||||||
DROP TABLE IF EXISTS t2;
|
--send DROP TABLE IF EXISTS t2
|
||||||
|
|
||||||
|
--echo # Create a new connection thread to orchestrate the ALTER and DROP
|
||||||
|
--echo # threads' DEBUG_SYNC points to avoid lost signals
|
||||||
|
connect(con2,localhost,root,,);
|
||||||
|
let $wait_condition= select count(*)=0 from information_schema.processlist where state like "debug sync point: alter_table_before_open_tables";
|
||||||
|
source include/wait_condition.inc;
|
||||||
|
SET DEBUG_SYNC= 'now SIGNAL mtr_continue';
|
||||||
|
|
||||||
|
# Return execution for DROP TABLE
|
||||||
|
connection default;
|
||||||
|
--reap
|
||||||
|
|
||||||
|
# Return execution for ALTER TABLE
|
||||||
connection con1;
|
connection con1;
|
||||||
--error ER_NO_SUCH_TABLE
|
--error ER_NO_SUCH_TABLE
|
||||||
--reap
|
--reap
|
||||||
|
|
||||||
SET DEBUG_SYNC= 'RESET';
|
SET DEBUG_SYNC= 'RESET';
|
||||||
disconnect con1;
|
disconnect con1;
|
||||||
--source include/wait_until_disconnected.inc
|
--source include/wait_until_disconnected.inc
|
||||||
|
@@ -197,8 +197,17 @@ SET DEBUG_SYNC="now WAIT_FOR parked1_2";
|
|||||||
--echo ** and finally release the mutex. The threads will continue to wait
|
--echo ** and finally release the mutex. The threads will continue to wait
|
||||||
--echo ** until a broadcast signal reaches them causing both threads to
|
--echo ** until a broadcast signal reaches them causing both threads to
|
||||||
--echo ** come alive and check the condition.
|
--echo ** come alive and check the condition.
|
||||||
|
|
||||||
|
# Before sending signals back-to-back, we have to ensure the previous signal
|
||||||
|
# was received
|
||||||
|
let $wait_condition= select count(*)=3 from information_schema.processlist where state like "%debug%";
|
||||||
|
source include/wait_condition.inc;
|
||||||
SET DEBUG_SYNC="now SIGNAL go2";
|
SET DEBUG_SYNC="now SIGNAL go2";
|
||||||
|
let $wait_condition= select count(*)=2 from information_schema.processlist where state like "%debug%";
|
||||||
|
source include/wait_condition.inc;
|
||||||
SET DEBUG_SYNC="now SIGNAL go3";
|
SET DEBUG_SYNC="now SIGNAL go3";
|
||||||
|
let $wait_condition= select count(*)=1 from information_schema.processlist where state like "%debug%";
|
||||||
|
source include/wait_condition.inc;
|
||||||
|
|
||||||
--echo **
|
--echo **
|
||||||
--echo ** Finally signal the DELETE statement on THD1 one last time.
|
--echo ** Finally signal the DELETE statement on THD1 one last time.
|
||||||
@@ -208,6 +217,8 @@ SET DEBUG_SYNC="now SIGNAL go3";
|
|||||||
--echo ** invalidations and a broadcast signal will be sent to the thread
|
--echo ** invalidations and a broadcast signal will be sent to the thread
|
||||||
--echo ** group holding result set writers.
|
--echo ** group holding result set writers.
|
||||||
SET DEBUG_SYNC="now SIGNAL go1_2";
|
SET DEBUG_SYNC="now SIGNAL go1_2";
|
||||||
|
let $wait_condition= select count(*)=0 from information_schema.processlist where state like "%debug%";
|
||||||
|
source include/wait_condition.inc;
|
||||||
|
|
||||||
--echo **
|
--echo **
|
||||||
--echo *************************************************************************
|
--echo *************************************************************************
|
||||||
|
@@ -43,6 +43,12 @@ START SLAVE;
|
|||||||
SET DEBUG_SYNC= 'now WAIT_FOR parked';
|
SET DEBUG_SYNC= 'now WAIT_FOR parked';
|
||||||
SET @@GLOBAL.debug_dbug = @saved_dbug;
|
SET @@GLOBAL.debug_dbug = @saved_dbug;
|
||||||
SET DEBUG_SYNC= 'now SIGNAL continue';
|
SET DEBUG_SYNC= 'now SIGNAL continue';
|
||||||
|
|
||||||
|
# Ensure the last DEBUG_SYNC signal was received by the target thread before
|
||||||
|
# reset; otherwise, the reset can drop the last signal before it gets
|
||||||
|
# acknowledged
|
||||||
|
let $wait_condition= select count(*)=0 from information_schema.processlist where state like "%debug%";
|
||||||
|
source include/wait_condition.inc;
|
||||||
SET DEBUG_SYNC= 'RESET';
|
SET DEBUG_SYNC= 'RESET';
|
||||||
|
|
||||||
--source include/wait_for_slave_io_to_start.inc
|
--source include/wait_for_slave_io_to_start.inc
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2014, 2021, MariaDB Corporation.
|
Copyright (c) 2014, 2022, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -466,6 +466,10 @@ static uint16_t trx_undo_header_create(buf_block_t *undo_page, trx_id_t trx_id,
|
|||||||
free);
|
free);
|
||||||
mtr->write<8,mtr_t::MAYBE_NOP>(*undo_page, free + TRX_UNDO_TRX_ID +
|
mtr->write<8,mtr_t::MAYBE_NOP>(*undo_page, free + TRX_UNDO_TRX_ID +
|
||||||
undo_page->frame, trx_id);
|
undo_page->frame, trx_id);
|
||||||
|
if (UNIV_UNLIKELY(mach_read_from_8(free + TRX_UNDO_TRX_NO +
|
||||||
|
undo_page->frame)))
|
||||||
|
mtr->memset(undo_page, free + TRX_UNDO_TRX_NO, 8, 0);
|
||||||
|
|
||||||
/* Write TRX_UNDO_NEEDS_PURGE=1 and TRX_UNDO_LOG_START. */
|
/* Write TRX_UNDO_NEEDS_PURGE=1 and TRX_UNDO_LOG_START. */
|
||||||
mach_write_to_2(buf, 1);
|
mach_write_to_2(buf, 1);
|
||||||
memcpy_aligned<2>(buf + 2, start, 2);
|
memcpy_aligned<2>(buf + 2, start, 2);
|
||||||
@@ -886,12 +890,19 @@ corrupted:
|
|||||||
sql_print_error("InnoDB: unsupported undo header state %u",
|
sql_print_error("InnoDB: unsupported undo header state %u",
|
||||||
state);
|
state);
|
||||||
goto corrupted;
|
goto corrupted;
|
||||||
|
case TRX_UNDO_CACHED:
|
||||||
|
if (UNIV_UNLIKELY(type != 0)) {
|
||||||
|
/* This undo page was not updated by MariaDB
|
||||||
|
10.3 or later. The TRX_UNDO_TRX_NO field may
|
||||||
|
contain garbage. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
goto read_trx_no;
|
||||||
case TRX_UNDO_TO_PURGE:
|
case TRX_UNDO_TO_PURGE:
|
||||||
if (UNIV_UNLIKELY(type == 1)) {
|
if (UNIV_UNLIKELY(type == 1)) {
|
||||||
goto corrupted_type;
|
goto corrupted_type;
|
||||||
}
|
}
|
||||||
/* fall through */
|
read_trx_no:
|
||||||
case TRX_UNDO_CACHED:
|
|
||||||
trx_id_t id = mach_read_from_8(TRX_UNDO_TRX_NO + undo_header);
|
trx_id_t id = mach_read_from_8(TRX_UNDO_TRX_NO + undo_header);
|
||||||
if (id >> 48) {
|
if (id >> 48) {
|
||||||
sql_print_error("InnoDB: corrupted TRX_NO %llx", id);
|
sql_print_error("InnoDB: corrupted TRX_NO %llx", id);
|
||||||
|
Reference in New Issue
Block a user