Commit 09049fe4 authored by Yuchen Pei's avatar Yuchen Pei

Merge branch '10.6' into 10.11

parents 2b8dc766 bdaa6bac
......@@ -47,4 +47,4 @@ SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
......@@ -4,7 +4,7 @@ SET @orig_debug=@@debug_dbug;
connection node_2;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
set debug_sync='RESET';
SET SESSION wsrep_sync_wait = 1;
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";
......@@ -45,4 +45,4 @@ SET SESSION wsrep_sync_wait = default;
DROP TABLE t_wait1;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
......@@ -4,7 +4,7 @@ SET @orig_debug=@@debug_dbug;
connection node_2;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
SET SESSION wsrep_sync_wait = 8;
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";
connection node_1;
......@@ -46,4 +46,4 @@ SET SESSION wsrep_sync_wait = default;
DROP TABLE t_wait8;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
connection node_2;
connection node_1;
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2), (3);
......@@ -22,6 +23,8 @@ COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
0
connection node_1;
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;
......@@ -36,10 +36,7 @@ SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
......
......@@ -7,6 +7,8 @@
# Without a PK
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
......@@ -41,5 +43,7 @@ TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 0 FROM t2;
--connection node_1
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;
......@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
Got one of the listed errors
SELECT * FROM t2;
a
1
......
......@@ -59,7 +59,7 @@ SELECT * FROM t1;
let $restart_parameters=--innodb_force_recovery=1;
--source include/restart_mysqld.inc
--error ER_TABLE_CORRUPT
--error ER_NO_SUCH_TABLE_IN_ENGINE,ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
......
......@@ -361,64 +361,68 @@ static bool dict_stats_process_entry_from_recalc_pool(THD *thd)
{
ut_ad(i->state == recalc::IN_PROGRESS);
recalc_pool.erase(i);
const bool reschedule= !update_now && recalc_pool.empty();
if (err == DB_SUCCESS_LOCKED_REC)
recalc_pool.emplace_back(recalc{table_id, recalc::IDLE});
mysql_mutex_unlock(&recalc_pool_mutex);
if (reschedule)
dict_stats_schedule(MIN_RECALC_INTERVAL * 1000);
}
return update_now;
}
static tpool::timer* dict_stats_timer;
static std::mutex dict_stats_mutex;
/** Check if the recalc pool is empty. */
static bool is_recalc_pool_empty()
{
mysql_mutex_lock(&recalc_pool_mutex);
bool empty= recalc_pool.empty();
mysql_mutex_unlock(&recalc_pool_mutex);
return empty;
}
static tpool::timer* dict_stats_timer;
static THD *dict_stats_thd;
static void dict_stats_func(void*)
{
THD *thd= innobase_create_background_thd("InnoDB statistics");
set_current_thd(thd);
while (dict_stats_process_entry_from_recalc_pool(thd)) {}
dict_defrag_process_entries_from_defrag_pool(thd);
if (!dict_stats_thd)
dict_stats_thd= innobase_create_background_thd("InnoDB statistics");
set_current_thd(dict_stats_thd);
while (dict_stats_process_entry_from_recalc_pool(dict_stats_thd)) {}
dict_defrag_process_entries_from_defrag_pool(dict_stats_thd);
innobase_reset_background_thd(dict_stats_thd);
set_current_thd(nullptr);
destroy_background_thd(thd);
if (!is_recalc_pool_empty())
dict_stats_schedule(MIN_RECALC_INTERVAL * 1000);
}
void dict_stats_start()
{
std::lock_guard<std::mutex> lk(dict_stats_mutex);
if (!dict_stats_timer)
DBUG_ASSERT(!dict_stats_timer);
dict_stats_timer= srv_thread_pool->create_timer(dict_stats_func);
}
static void dict_stats_schedule(int ms)
{
std::unique_lock<std::mutex> lk(dict_stats_mutex, std::defer_lock);
/*
Use try_lock() to avoid deadlock in dict_stats_shutdown(), which
uses dict_stats_mutex too. If there is simultaneous timer reschedule,
the first one will win, which is fine.
*/
if (!lk.try_lock())
{
return;
}
if (dict_stats_timer)
if(dict_stats_timer)
dict_stats_timer->set_time(ms,0);
}
void dict_stats_schedule_now()
{
dict_stats_schedule(10);
dict_stats_schedule(0);
}
/** Shut down the dict_stats_thread. */
void dict_stats_shutdown()
{
std::lock_guard<std::mutex> lk(dict_stats_mutex);
delete dict_stats_timer;
dict_stats_timer= 0;
if (dict_stats_thd)
{
destroy_background_thd(dict_stats_thd);
dict_stats_thd= 0;
}
}
......@@ -696,6 +696,46 @@ static LEX_STRING spider_init_queries[] = {
" add column if not exists driver char(64) default null after filedsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_link_mon_servers"
" add column if not exists filedsn text default null after dsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_tables"
" add column if not exists filedsn text default null after dsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_xa_failed_log"
" add column if not exists filedsn text default null after dsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_xa_member"
" add column if not exists filedsn text default null after dsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_link_mon_servers"
" add column if not exists driver char(64) default null after filedsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_tables"
" add column if not exists driver char(64) default null after filedsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_xa_failed_log"
" add column if not exists driver char(64) default null after filedsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"alter table mysql.spider_xa_member"
" add column if not exists driver char(64) default null after filedsn,"
" algorithm=copy, lock=shared;"
)},
{C_STRING_WITH_LEN(
"set @win_plugin := IF(@@version_compile_os like 'Win%', 1, 0);"
)},
......
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