Skip to content

Commit 975b40e

Browse files
committed
Merge 10.9 into 10.10
2 parents 63961a0 + 4a16436 commit 975b40e

File tree

8 files changed

+52
-50
lines changed

8 files changed

+52
-50
lines changed

mysql-test/main/backup_locks.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ a
3232
connection con1;
3333
drop table t1;
3434
connection default;
35-
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
35+
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
3636
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
3737
MDL_SHARED_HIGH_PRIO Table metadata lock test t1
3838
MDL_INTENTION_EXCLUSIVE Schema metadata lock test

mysql-test/main/backup_locks.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let $wait_condition=
3939
select count(*) = 1 from information_schema.processlist
4040
where state = "Waiting for table metadata lock";
4141
--source include/wait_condition.inc
42-
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
42+
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
4343
--error ER_LOCK_DEADLOCK
4444
select * from t1;
4545
backup unlock;

mysql-test/suite/encryption/r/innodb-redo-nokeys.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
55
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
66
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
77
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
8+
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
9+
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
10+
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
811
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
912
SET GLOBAL innodb_file_per_table = ON;
1013
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;

mysql-test/suite/encryption/t/innodb-redo-nokeys.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
1010
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
1111
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
1212
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
13+
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
14+
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
15+
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
1316

1417
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
1518
-- source include/restart_mysqld.inc

scripts/wsrep_sst_mariabackup.sh

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ encrypt_chunk=""
8787

8888
readonly SECRET_TAG='secret'
8989
readonly TOTAL_TAG='total'
90-
readonly TOTAL_TAG_SST="$SECRET_TAG /$TOTAL_TAG"
9190

9291
# Required for backup locks
9392
# For backup locks it is 1 sent by joiner
@@ -452,7 +451,7 @@ get_footprint()
452451
wsrep_log_info \
453452
"SST footprint estimate: data: $payload_data, undo: $payload_undo"
454453

455-
payload=$(( $payload_data + $payload_undo ))
454+
payload=$(( payload_data + payload_undo ))
456455

457456
if [ "$compress" != 'none' ]; then
458457
# QuickLZ has around 50% compression ratio
@@ -505,6 +504,7 @@ adjust_progress()
505504
pcmd="$pcmd 2>'$progress'"
506505
fi
507506
fi
507+
508508
elif [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
509509

510510
# Default progress output parseable by parent
@@ -518,6 +518,7 @@ adjust_progress()
518518

519519
# Rate-limiting only, when rlimit is non-zero
520520
pcmd="pv -q$rlimitopts"
521+
521522
fi
522523
}
523524

@@ -853,14 +854,6 @@ recv_joiner()
853854
fi
854855
fi
855856
fi
856-
857-
# check total SST footprint
858-
total=$(grep -F -- "$TOTAL_TAG " "$MAGIC_FILE" 2>/dev/null | cut -d ' ' -f 3)
859-
if [ $total -ge 0 ]; then
860-
# report to parent
861-
echo "$TOTAL_TAG $total"
862-
fi
863-
864857
fi
865858
}
866859

@@ -1085,9 +1078,6 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
10851078
# (separated by a space).
10861079
echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
10871080

1088-
# Tell joiner what to expect:
1089-
echo "$TOTAL_TAG_SST $payload" >> "$MAGIC_FILE"
1090-
10911081
if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then
10921082
# Let joiner know that we know its secret
10931083
echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
@@ -1332,17 +1322,6 @@ else # joiner
13321322
strmcmd="$sdecomp | $strmcmd"
13331323
fi
13341324

1335-
adjust_progress
1336-
if [ -n "$pcmd" ]; then
1337-
if [ -n "$rcmd" ]; then
1338-
# redirect pv stderr to rcmd for tagging and output to parent
1339-
strmcmd="{ $pcmd 2>&3 | $strmcmd; } 3>&1 | $rcmd"
1340-
else
1341-
# use user-configured pv output
1342-
strmcmd="$pcmd | $strmcmd"
1343-
fi
1344-
fi
1345-
13461325
check_sockets_utils
13471326

13481327
trap cleanup_at_exit EXIT

sql/sql_base.cc

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class flush_tables_error_handler : public Internal_error_handler
514514
Sql_condition ** cond_hdl)
515515
{
516516
*cond_hdl= NULL;
517-
if (sql_errno == ER_OPEN_AS_READONLY)
517+
if (sql_errno == ER_OPEN_AS_READONLY || sql_errno == ER_LOCK_WAIT_TIMEOUT)
518518
{
519519
handled_errors++;
520520
return TRUE;
@@ -599,24 +599,43 @@ bool flush_tables(THD *thd, flush_tables_type flag)
599599
else
600600
{
601601
/*
602-
HA_OPEN_FOR_FLUSH is used to allow us to open the table even if
603-
TABLE_SHARE::incompatible_version is set. It also will tell
604-
SEQUENCE engine that we don't have to read the sequence information
605-
(which may cause deadlocks with concurrently running ALTER TABLE or
606-
ALTER SEQUENCE) as we will close the table at once.
602+
No free TABLE instances available. We have to open a new one.
603+
604+
Try to take a MDL lock to ensure we can open a new table instance.
605+
If the lock fails, it means that some DDL operation or flush tables
606+
with read lock is ongoing.
607+
In this case we cannot sending the HA_EXTRA_FLUSH signal.
607608
*/
608-
if (!open_table_from_share(thd, share, &empty_clex_str,
609-
HA_OPEN_KEYFILE, 0,
610-
HA_OPEN_FOR_ALTER | HA_OPEN_FOR_FLUSH,
611-
tmp_table, FALSE,
612-
NULL))
609+
610+
MDL_request mdl_request;
611+
MDL_REQUEST_INIT(&mdl_request, MDL_key::TABLE,
612+
share->db.str,
613+
share->table_name.str,
614+
MDL_SHARED, MDL_EXPLICIT);
615+
616+
if (!thd->mdl_context.acquire_lock(&mdl_request, 0))
613617
{
614-
(void) tmp_table->file->extra(HA_EXTRA_FLUSH);
615618
/*
616-
We don't put the table into the TDC as the table was not fully
617-
opened (we didn't open triggers)
619+
HA_OPEN_FOR_FLUSH is used to allow us to open the table even if
620+
TABLE_SHARE::incompatible_version is set. It also will tell
621+
SEQUENCE engine that we don't have to read the sequence information
622+
(which may cause deadlocks with concurrently running ALTER TABLE or
623+
ALTER SEQUENCE) as we will close the table at once.
618624
*/
619-
closefrm(tmp_table);
625+
if (!open_table_from_share(thd, share, &empty_clex_str,
626+
HA_OPEN_KEYFILE, 0,
627+
HA_OPEN_FOR_ALTER | HA_OPEN_FOR_FLUSH,
628+
tmp_table, FALSE,
629+
NULL))
630+
{
631+
(void) tmp_table->file->extra(HA_EXTRA_FLUSH);
632+
/*
633+
We don't put the table into the TDC as the table was not fully
634+
opened (we didn't open triggers)
635+
*/
636+
closefrm(tmp_table);
637+
}
638+
thd->mdl_context.release_lock(mdl_request.ticket);
620639
}
621640
}
622641
tdc_release_share(share);

sql/wsrep_sst.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ static ssize_t sst_prepare_other (const char* method,
11561156
method, addr_in, mysql_real_data_home,
11571157
wsrep_defaults_file,
11581158
(int)getpid(),
1159-
0,
1159+
wsrep_debug ? 1 : 0,
11601160
binlog_opt_val, binlog_index_opt_val);
11611161

11621162
my_free(binlog_opt_val);
@@ -1970,7 +1970,7 @@ static int sst_donate_other (const char* method,
19701970
"%s"
19711971
"%s",
19721972
method, addr, mysqld_port, mysqld_unix_port,
1973-
0,
1973+
wsrep_debug ? 1 : 0,
19741974
mysql_real_data_home,
19751975
wsrep_defaults_file,
19761976
uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id,

storage/innobase/log/log0recv.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -946,17 +946,13 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
946946
(fil_space_t::zip_size(flags),
947947
page), size);
948948
if (!space)
949-
{
950-
block->page.lock.x_unlock();
951-
goto fail;
952-
}
949+
goto release_and_fail;
953950
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
954951
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
955-
block->page.lock.x_unlock();
956952
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
957953
node->deferred= true;
958954
if (!space->acquire())
959-
goto fail;
955+
goto release_and_fail;
960956
fil_names_dirty(space);
961957
const bool is_compressed= fil_space_t::is_compressed(flags);
962958
#ifdef _WIN32
@@ -973,14 +969,16 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
973969
~4095ULL, is_sparse))
974970
{
975971
space->release();
976-
goto fail;
972+
goto release_and_fail;
977973
}
978974
node->deferred= false;
979975
space->release();
980976
it->second.space= space;
977+
block->page.lock.x_unlock();
981978
return false;
982979
}
983980

981+
release_and_fail:
984982
block->page.lock.x_unlock();
985983
}
986984

0 commit comments

Comments
 (0)