Commit 975b40ea authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.9 into 10.10

parents 63961a08 4a164364
...@@ -32,7 +32,7 @@ a ...@@ -32,7 +32,7 @@ a
connection con1; connection con1;
drop table t1; drop table t1;
connection default; connection default;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info; SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock test t1 MDL_SHARED_HIGH_PRIO Table metadata lock test t1
MDL_INTENTION_EXCLUSIVE Schema metadata lock test MDL_INTENTION_EXCLUSIVE Schema metadata lock test
......
...@@ -39,7 +39,7 @@ let $wait_condition= ...@@ -39,7 +39,7 @@ let $wait_condition=
select count(*) = 1 from information_schema.processlist select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock"; where state = "Waiting for table metadata lock";
--source include/wait_condition.inc --source include/wait_condition.inc
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info; SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
--error ER_LOCK_DEADLOCK --error ER_LOCK_DEADLOCK
select * from t1; select * from t1;
backup unlock; backup unlock;
......
...@@ -5,6 +5,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted"); ...@@ -5,6 +5,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\."); call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
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'"); 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'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt # restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
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; 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;
......
...@@ -10,6 +10,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted"); ...@@ -10,6 +10,9 @@ call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\."); call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
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'"); 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'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
call mtr.add_suppression("InnoDB: OPT_PAGE_CHECKSUM mismatch");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc -- source include/restart_mysqld.inc
......
...@@ -87,7 +87,6 @@ encrypt_chunk="" ...@@ -87,7 +87,6 @@ encrypt_chunk=""
readonly SECRET_TAG='secret' readonly SECRET_TAG='secret'
readonly TOTAL_TAG='total' readonly TOTAL_TAG='total'
readonly TOTAL_TAG_SST="$SECRET_TAG /$TOTAL_TAG"
# Required for backup locks # Required for backup locks
# For backup locks it is 1 sent by joiner # For backup locks it is 1 sent by joiner
...@@ -452,7 +451,7 @@ get_footprint() ...@@ -452,7 +451,7 @@ get_footprint()
wsrep_log_info \ wsrep_log_info \
"SST footprint estimate: data: $payload_data, undo: $payload_undo" "SST footprint estimate: data: $payload_data, undo: $payload_undo"
payload=$(( $payload_data + $payload_undo )) payload=$(( payload_data + payload_undo ))
if [ "$compress" != 'none' ]; then if [ "$compress" != 'none' ]; then
# QuickLZ has around 50% compression ratio # QuickLZ has around 50% compression ratio
...@@ -505,6 +504,7 @@ adjust_progress() ...@@ -505,6 +504,7 @@ adjust_progress()
pcmd="$pcmd 2>'$progress'" pcmd="$pcmd 2>'$progress'"
fi fi
fi fi
elif [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then elif [ $WSREP_SST_OPT_PROGRESS -eq 1 ]; then
# Default progress output parseable by parent # Default progress output parseable by parent
...@@ -518,6 +518,7 @@ adjust_progress() ...@@ -518,6 +518,7 @@ adjust_progress()
# Rate-limiting only, when rlimit is non-zero # Rate-limiting only, when rlimit is non-zero
pcmd="pv -q$rlimitopts" pcmd="pv -q$rlimitopts"
fi fi
} }
...@@ -853,14 +854,6 @@ recv_joiner() ...@@ -853,14 +854,6 @@ recv_joiner()
fi fi
fi fi
fi fi
# check total SST footprint
total=$(grep -F -- "$TOTAL_TAG " "$MAGIC_FILE" 2>/dev/null | cut -d ' ' -f 3)
if [ $total -ge 0 ]; then
# report to parent
echo "$TOTAL_TAG $total"
fi
fi fi
} }
...@@ -1085,9 +1078,6 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then ...@@ -1085,9 +1078,6 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
# (separated by a space). # (separated by a space).
echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE" echo "$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" > "$MAGIC_FILE"
# Tell joiner what to expect:
echo "$TOTAL_TAG_SST $payload" >> "$MAGIC_FILE"
if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then if [ -n "$WSREP_SST_OPT_REMOTE_PSWD" ]; then
# Let joiner know that we know its secret # Let joiner know that we know its secret
echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE" echo "$SECRET_TAG $WSREP_SST_OPT_REMOTE_PSWD" >> "$MAGIC_FILE"
...@@ -1332,17 +1322,6 @@ else # joiner ...@@ -1332,17 +1322,6 @@ else # joiner
strmcmd="$sdecomp | $strmcmd" strmcmd="$sdecomp | $strmcmd"
fi fi
adjust_progress
if [ -n "$pcmd" ]; then
if [ -n "$rcmd" ]; then
# redirect pv stderr to rcmd for tagging and output to parent
strmcmd="{ $pcmd 2>&3 | $strmcmd; } 3>&1 | $rcmd"
else
# use user-configured pv output
strmcmd="$pcmd | $strmcmd"
fi
fi
check_sockets_utils check_sockets_utils
trap cleanup_at_exit EXIT trap cleanup_at_exit EXIT
......
...@@ -514,7 +514,7 @@ class flush_tables_error_handler : public Internal_error_handler ...@@ -514,7 +514,7 @@ class flush_tables_error_handler : public Internal_error_handler
Sql_condition ** cond_hdl) Sql_condition ** cond_hdl)
{ {
*cond_hdl= NULL; *cond_hdl= NULL;
if (sql_errno == ER_OPEN_AS_READONLY) if (sql_errno == ER_OPEN_AS_READONLY || sql_errno == ER_LOCK_WAIT_TIMEOUT)
{ {
handled_errors++; handled_errors++;
return TRUE; return TRUE;
...@@ -599,24 +599,43 @@ bool flush_tables(THD *thd, flush_tables_type flag) ...@@ -599,24 +599,43 @@ bool flush_tables(THD *thd, flush_tables_type flag)
else else
{ {
/* /*
HA_OPEN_FOR_FLUSH is used to allow us to open the table even if No free TABLE instances available. We have to open a new one.
TABLE_SHARE::incompatible_version is set. It also will tell
SEQUENCE engine that we don't have to read the sequence information Try to take a MDL lock to ensure we can open a new table instance.
(which may cause deadlocks with concurrently running ALTER TABLE or If the lock fails, it means that some DDL operation or flush tables
ALTER SEQUENCE) as we will close the table at once. with read lock is ongoing.
In this case we cannot sending the HA_EXTRA_FLUSH signal.
*/ */
if (!open_table_from_share(thd, share, &empty_clex_str,
HA_OPEN_KEYFILE, 0, MDL_request mdl_request;
HA_OPEN_FOR_ALTER | HA_OPEN_FOR_FLUSH, MDL_REQUEST_INIT(&mdl_request, MDL_key::TABLE,
tmp_table, FALSE, share->db.str,
NULL)) share->table_name.str,
MDL_SHARED, MDL_EXPLICIT);
if (!thd->mdl_context.acquire_lock(&mdl_request, 0))
{ {
(void) tmp_table->file->extra(HA_EXTRA_FLUSH);
/* /*
We don't put the table into the TDC as the table was not fully HA_OPEN_FOR_FLUSH is used to allow us to open the table even if
opened (we didn't open triggers) TABLE_SHARE::incompatible_version is set. It also will tell
SEQUENCE engine that we don't have to read the sequence information
(which may cause deadlocks with concurrently running ALTER TABLE or
ALTER SEQUENCE) as we will close the table at once.
*/ */
closefrm(tmp_table); if (!open_table_from_share(thd, share, &empty_clex_str,
HA_OPEN_KEYFILE, 0,
HA_OPEN_FOR_ALTER | HA_OPEN_FOR_FLUSH,
tmp_table, FALSE,
NULL))
{
(void) tmp_table->file->extra(HA_EXTRA_FLUSH);
/*
We don't put the table into the TDC as the table was not fully
opened (we didn't open triggers)
*/
closefrm(tmp_table);
}
thd->mdl_context.release_lock(mdl_request.ticket);
} }
} }
tdc_release_share(share); tdc_release_share(share);
......
...@@ -1156,7 +1156,7 @@ static ssize_t sst_prepare_other (const char* method, ...@@ -1156,7 +1156,7 @@ static ssize_t sst_prepare_other (const char* method,
method, addr_in, mysql_real_data_home, method, addr_in, mysql_real_data_home,
wsrep_defaults_file, wsrep_defaults_file,
(int)getpid(), (int)getpid(),
0, wsrep_debug ? 1 : 0,
binlog_opt_val, binlog_index_opt_val); binlog_opt_val, binlog_index_opt_val);
my_free(binlog_opt_val); my_free(binlog_opt_val);
...@@ -1970,7 +1970,7 @@ static int sst_donate_other (const char* method, ...@@ -1970,7 +1970,7 @@ static int sst_donate_other (const char* method,
"%s" "%s"
"%s", "%s",
method, addr, mysqld_port, mysqld_unix_port, method, addr, mysqld_port, mysqld_unix_port,
0, wsrep_debug ? 1 : 0,
mysql_real_data_home, mysql_real_data_home,
wsrep_defaults_file, wsrep_defaults_file,
uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id, uuid_oss.str().c_str(), gtid.seqno().get(), wsrep_gtid_server.domain_id,
......
...@@ -946,17 +946,13 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p, ...@@ -946,17 +946,13 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
(fil_space_t::zip_size(flags), (fil_space_t::zip_size(flags),
page), size); page), size);
if (!space) if (!space)
{ goto release_and_fail;
block->page.lock.x_unlock();
goto fail;
}
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
block->page.lock.x_unlock();
fil_node_t *node= UT_LIST_GET_FIRST(space->chain); fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
node->deferred= true; node->deferred= true;
if (!space->acquire()) if (!space->acquire())
goto fail; goto release_and_fail;
fil_names_dirty(space); fil_names_dirty(space);
const bool is_compressed= fil_space_t::is_compressed(flags); const bool is_compressed= fil_space_t::is_compressed(flags);
#ifdef _WIN32 #ifdef _WIN32
...@@ -973,14 +969,16 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p, ...@@ -973,14 +969,16 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
~4095ULL, is_sparse)) ~4095ULL, is_sparse))
{ {
space->release(); space->release();
goto fail; goto release_and_fail;
} }
node->deferred= false; node->deferred= false;
space->release(); space->release();
it->second.space= space; it->second.space= space;
block->page.lock.x_unlock();
return false; return false;
} }
release_and_fail:
block->page.lock.x_unlock(); block->page.lock.x_unlock();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment