Commit 0ecc4fe2 authored by Raghavendra D Prabhu's avatar Raghavendra D Prabhu Committed by Nirbhay Choubey

Bug#1421360: Add Percona Server specific FLUSH statements.

Added following:

        FLUSH CLIENT_STATISTICS
        FLUSH INDEX_STATISTICS
        FLUSH TABLE_STATISTICS
        FLUSH THREAD_STATISTICS
        FLUSH USER_STATISTICS

pertaining to USER STATISTICS
https://www.percona.com/doc/percona-server/5.6/diagnostics/user_stats.html

        FLUSH CHANGED_PAGE_BITMAPS

pertaining to changed page tracking.
https://www.percona.com/doc/percona-server/5.6/management/changed_page_tracking.html

Also, added tests for them.

(cherry picked from commit 7efe49010c7f217663f364657090812b4723f426)

Conflicts:
	mysql-test/suite/galera/r/galera_flush.result
	mysql-test/suite/galera/r/galera_flush_gtid.result
	mysql-test/suite/galera/t/galera_flush.test
	sql/sql_parse.cc
parent 1077eef9
DROP TABLE IF EXISTS t1, t2;
FLUSH DES_KEY_FILE;
wsrep_last_committed_diff
1
......@@ -26,6 +27,37 @@ CREATE TABLE t2 (f1 INTEGER);
FLUSH TABLES t2;
wsrep_last_committed_diff
1
FLUSH ERROR LOGS;
wsrep_last_committed_diff
1
FLUSH SLOW LOGS;
wsrep_last_committed_diff
1
FLUSH GENERAL LOGS;
wsrep_last_committed_diff
1
FLUSH ENGINE LOGS;
wsrep_last_committed_diff
1
FLUSH RELAY LOGS;
wsrep_last_committed_diff
1
SET @userstat_old= @@userstat;
SET GLOBAL userstat=ON;
FLUSH CLIENT_STATISTICS;
FLUSH INDEX_STATISTICS;
FLUSH TABLE_STATISTICS;
FLUSH USER_STATISTICS;
wsrep_last_committed_diff
1
SET @old_thread_statistics= @@global.thread_statistics;
SET GLOBAL thread_statistics= ON;
FLUSH THREAD_STATISTICS;
wsrep_last_committed_diff
1
FLUSH CHANGED_PAGE_BITMAPS;
wsrep_last_committed_diff
1
CREATE TABLE t1 (f1 INTEGER);
FLUSH LOGS;
FLUSH TABLES WITH READ LOCK;
......@@ -52,3 +84,5 @@ wsrep_last_committed_diff
1
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL userstat= @userstat_old;
SET GLOBAL thread_statistics= @old_thread_statistics;
......@@ -7,6 +7,9 @@
--source include/have_perfschema.inc
--source include/have_query_cache.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
#
# The following FLUSH statements should be replicated
#
......@@ -101,6 +104,101 @@ FLUSH TABLES t2;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH ERROR LOGS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH SLOW LOGS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH GENERAL LOGS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH ENGINE LOGS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH RELAY LOGS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_1
SET @userstat_old= @@userstat;
SET GLOBAL userstat=ON;
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH CLIENT_STATISTICS;
FLUSH INDEX_STATISTICS;
FLUSH TABLE_STATISTICS;
FLUSH USER_STATISTICS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 4 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_1
SET @old_thread_statistics= @@global.thread_statistics;
SET GLOBAL thread_statistics= ON;
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH THREAD_STATISTICS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
FLUSH CHANGED_PAGE_BITMAPS;
--connection node_2
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--disable_query_log
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 1 AS wsrep_last_committed_diff;
--enable_query_log
#
# The following statements should not be replicated: FLUSH LOGS, FLUSH TABLES WITH LOCKS
#
......@@ -171,3 +269,5 @@ FLUSH TABLES t1;
--connection node_1
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL userstat= @userstat_old;
SET GLOBAL thread_statistics= @old_thread_statistics;
......@@ -4670,14 +4670,36 @@ case SQLCOM_PREPARE:
#ifdef WITH_WSREP
if (lex->type & (
REFRESH_GRANT |
REFRESH_HOSTS |
REFRESH_DES_KEY_FILE |
REFRESH_GRANT |
REFRESH_HOSTS |
#ifdef HAVE_OPENSSL
REFRESH_DES_KEY_FILE |
#endif
/*
Write all flush log statements except
FLUSH LOGS
FLUSH BINARY LOGS
Check reload_acl_and_cache for why.
*/
REFRESH_RELAY_LOG |
REFRESH_SLOW_LOG |
REFRESH_GENERAL_LOG |
REFRESH_ENGINE_LOG |
REFRESH_ERROR_LOG |
#ifdef HAVE_QUERY_CACHE
REFRESH_QUERY_CACHE_FREE |
REFRESH_QUERY_CACHE_FREE |
#endif /* HAVE_QUERY_CACHE */
REFRESH_STATUS |
REFRESH_USER_RESOURCES))
REFRESH_STATUS |
REFRESH_USER_RESOURCES |
/*
Percona Server specific
*/
REFRESH_FLUSH_PAGE_BITMAPS |
REFRESH_TABLE_STATS |
REFRESH_INDEX_STATS |
REFRESH_USER_STATS |
REFRESH_CLIENT_STATS |
REFRESH_THREAD_STATS))
{
WSREP_TO_ISOLATION_BEGIN_WRTCHK(WSREP_MYSQL_DB, NULL, NULL)
}
......
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