mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 04:26:45 +03:00 
			
		
		
		
	New test cases
        innodb-page-cleaners
Modified test cases
        innodb_page_cleaners_basic
New function buf_flush_set_page_cleaner_thread_cnt
    Increase or decrease the amount of page cleaner worker threads.
    In case of increase this function creates based on current
    abount and requested amount how many new threads should be
    created. In case of decrease this function sets up the
    requested amount of threads and uses is_requested event
    to signal workers. Then we wait until all new treads
    are started, old threads that should exit signal
    is_finished or shutdown has marked that page cleaner
    should finish.
buf_flush_page_cleaner_worker
        Store current thread id and thread_no and then signal
        event is_finished. If number of used page cleaner threads
        decrease we shut down those threads that have thread_no
        greater or equal than number of page configured page
        cleaners - 1 (note that there will be always page cleaner
        coordinator). Before exiting we signal is_finished.
New function innodb_page_cleaners_threads_update
        Update function for innodb-page-cleaners system variable.
innobase_start_or_create_for_mysql
        If more than one page cleaner threads is configured
        we use new function buf_flush_set_page_cleaner_thread_cnt
        to set up the requested threads (-1 coordinator).
		
	
		
			
				
	
	
		
			80 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			80 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Variable name: innodb_page_cleaners
 | |
| # Scope: Global
 | |
| # Access type: Dynamic
 | |
| # Data type: numeric
 | |
| 
 | |
| --source include/have_innodb.inc
 | |
| 
 | |
| SELECT COUNT(@@GLOBAL.innodb_page_cleaners);
 | |
| --echo 1 Expected
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 1 Expected
 | |
| 
 | |
| SET @@GLOBAL.innodb_page_cleaners=2;
 | |
| --echo Expected to pass
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 2 Expected
 | |
| 
 | |
| SET @@GLOBAL.innodb_page_cleaners=1;
 | |
| --echo Expected to pass
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 1 Expected
 | |
| 
 | |
| SET @@GLOBAL.innodb_page_cleaners=6;
 | |
| --echo Expected to pass
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 6 Expected
 | |
| 
 | |
| SET @@GLOBAL.innodb_page_cleaners=4;
 | |
| --echo Expected to pass
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 4 Expected
 | |
| 
 | |
| SET @@GLOBAL.innodb_page_cleaners=0;
 | |
| --echo Warning expected
 | |
| 
 | |
| SELECT @@innodb_page_cleaners;
 | |
| --echo 1 Expected
 | |
| 
 | |
| --Error ER_BAD_FIELD_ERROR
 | |
| SELECT innodb_page_cleaners = @@SESSION.innodb_page_cleaners;
 | |
| --echo Expected error 'Read-only variable'
 | |
| 
 | |
| --disable_warnings
 | |
| SELECT @@GLOBAL.innodb_page_cleaners = VARIABLE_VALUE
 | |
| FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 | |
| WHERE VARIABLE_NAME='innodb_page_cleaners';
 | |
| --enable_warnings
 | |
| --echo 1 Expected
 | |
| 
 | |
| --disable_warnings
 | |
| SELECT COUNT(VARIABLE_VALUE)
 | |
| FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 | |
| WHERE VARIABLE_NAME='innodb_page_cleaners';
 | |
| --enable_warnings
 | |
| --echo 1 Expected
 | |
| 
 | |
| SELECT @@innodb_page_cleaners = @@GLOBAL.innodb_page_cleaners;
 | |
| --echo 1 Expected
 | |
| 
 | |
| --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 | |
| SELECT COUNT(@@local.innodb_page_cleaners);
 | |
| --echo Expected error 'Variable is a GLOBAL variable'
 | |
| 
 | |
| --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 | |
| SELECT COUNT(@@SESSION.innodb_page_cleaners);
 | |
| --echo Expected error 'Variable is a GLOBAL variable'
 | |
| 
 | |
| # Check the default value
 | |
| --disable_warnings
 | |
| SELECT VARIABLE_NAME, VARIABLE_VALUE
 | |
| FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 | |
| WHERE VARIABLE_NAME = 'innodb_page_cleaners';
 | |
| --enable_warnings
 | |
| 
 |