mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-26 16:38:11 +01:00 
			
		
		
		
	 1ed09cfdcb
			
		
	
	
	1ed09cfdcb
	
	
	
		
			
			innodb_stats_transient_sample_pages, innodb_stats_persistent_sample_pages: Change the type to UNSIGNED, because the number of pages in a table is limited to 32 bits by the InnoDB file format. btr_get_size_and_reserved(), fseg_get_n_frag_pages(), fseg_n_reserved_pages_low(), fseg_n_reserved_pages(): Return uint32_t. The file format limits page numbers to 32 bits. dict_table_t::stat: An Atomic_relaxed<uint32_t> that combines a number of metadata fields. innodb_copy_stat_flags(): Copy the statistics flags from TABLE_SHARE or HA_CREATE_INFO. dict_table_t::stats_initialized(), dict_table_t::stats_is_persistent(): Accessors to dict_table_t::stat. Reviewed by: Thirunarayanan Balathandayuthapani
		
			
				
	
	
		
			55 lines
		
	
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /*****************************************************************************
 | |
| 
 | |
| Copyright (c) 2023, MariaDB Corporation.
 | |
| 
 | |
| This program is free software; you can redistribute it and/or modify it under
 | |
| the terms of the GNU General Public License as published by the Free Software
 | |
| Foundation; version 2 of the License.
 | |
| 
 | |
| This program is distributed in the hope that it will be useful, but WITHOUT
 | |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 | |
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 | |
| 
 | |
| You should have received a copy of the GNU General Public License along with
 | |
| this program; if not, write to the Free Software Foundation, Inc.,
 | |
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
 | |
| 
 | |
| *****************************************************************************/
 | |
| 
 | |
| #include "db0err.h"
 | |
| 
 | |
| /* The purpose of the change buffer was to reduce random disk access.
 | |
| When we wished to
 | |
| (1) insert a record into a non-unique secondary index,
 | |
| (2) delete-mark a secondary index record,
 | |
| (3) delete a secondary index record as part of purge (but not ROLLBACK),
 | |
| and the B-tree leaf page where the record belongs to is not in the buffer
 | |
| pool, we inserted a record into the change buffer B-tree, indexed by
 | |
| the page identifier. When the page was eventually read into the buffer
 | |
| pool, we looked up the change buffer B-tree for any modifications to the
 | |
| page, applied these upon the completion of the read operation. This
 | |
| was called the insert buffer merge.
 | |
| 
 | |
| There was a hash index of the change buffer B-tree, implemented as the
 | |
| "change buffer bitmap". Bits in these bitmap pages indicated how full
 | |
| the page roughly was, and whether any records for the page identifier
 | |
| exist in the change buffer. The "free" bits had to be updated as part of
 | |
| operations that modified secondary index leaf pages.
 | |
| 
 | |
| Because the change buffer has been removed, we will no longer update
 | |
| any change buffer bitmap pages. Instead, on database startup, we will
 | |
| check if an upgrade needs to be performed, and apply any buffered
 | |
| changes if that is the case. Finally, the change buffer will be
 | |
| transformed to a format that will not be recognized by earlier
 | |
| versions of MariaDB Server, to prevent downgrades from causing
 | |
| corruption (due to the removed updates of the bitmap pages) when the
 | |
| change buffer might be enabled. */
 | |
| 
 | |
| /** Check if ibuf_upgrade() is needed as part of server startup.
 | |
| @return error code
 | |
| @retval DB_SUCCESS if no upgrade is needed
 | |
| @retval DB_FAIL    if the change buffer is not empty (need ibuf_upgrade()) */
 | |
| dberr_t ibuf_upgrade_needed();
 | |
| 
 | |
| /** Upgrade the change buffer after all redo log has been applied. */
 | |
| dberr_t ibuf_upgrade();
 |