Represents infrastructure needed for tablespace files scanning during server bootstrap.
More...
#include <fil0tablespace_scan.h>
Represents infrastructure needed for tablespace files scanning during server bootstrap.
◆ Scanning_state
| Enumerator |
|---|
| UNINITED | |
| INITED | |
| CLEARED | |
◆ add_scan_dir()
| void ib::fil::Tablespace_scanning::add_scan_dir |
( |
const std::string & |
directory | ) |
|
|
inline |
Normalize and save a directory to scan for IBD and IBU datafiles before recovery.
- Parameters
-
| [in] | directory | directory to scan for IBD and IBU files |
◆ add_scan_dirs()
| void ib::fil::Tablespace_scanning::add_scan_dirs |
( |
const std::string & |
directories | ) |
|
|
inline |
Normalize and save a list of directories to scan for IBD and IBU datafiles before recovery.
- Parameters
-
| [in] | directories | Directories to scan for IBD and IBU files |
◆ check_missing_tablespaces()
| bool ib::fil::Tablespace_scanning::check_missing_tablespaces |
( |
| ) |
|
This function should be called after recovery has completed.
Check for tablespace files for which we did not see any MLOG_FILE_DELETE or MLOG_FILE_RENAME record. These could not be recovered
- Returns
- true if there were some filenames missing for which we had to ignore redo log records during the apply phase
◆ clear()
| void ib::fil::Tablespace_scanning::clear |
( |
| ) |
|
|
inline |
Free the data structures required for recovery.
◆ erase_path()
| bool ib::fil::Tablespace_scanning::erase_path |
( |
space_id_t |
space_id | ) |
|
|
inline |
Erase a space ID to filename mapping.
- Parameters
-
| [in] | space_id | Tablespace ID to erase |
- Returns
- true if successful
◆ get_dirs()
| std::string ib::fil::Tablespace_scanning::get_dirs |
( |
| ) |
|
|
inline |
Get the list of directories that InnoDB knows about.
- Returns
- the list of directories 'dir1;dir2;....;dirN'
◆ get_found_space_ids()
| void ib::fil::Tablespace_scanning::get_found_space_ids |
( |
std::vector< space_id_t > & |
space_ids | ) |
|
|
inline |
Returns the list of tablespace ids found during scan.
- Parameters
-
| [out] | space_ids | List of tablespace ids discovered. |
◆ get_scanned_filename_by_space_id()
Fetch the file names opened for a space_id during recovery.
- Parameters
-
| [in] | space_id | Tablespace ID to lookup |
- Returns
- pair of top level directory scanned and names that map to space_id or nullptr if not found.
◆ get_tablespace_file_by_id()
| std::optional< std::string > ib::fil::Tablespace_scanning::get_tablespace_file_by_id |
( |
space_id_t |
space_id | ) |
|
Fetch the file name opened for a space_id from the file map.
- Parameters
-
| [in] | space_id | tablespace ID |
- Returns
- Tablespace file name if Tablespace with the id is found, nullopt otherwise
◆ get_tablespace_page_size()
| std::optional< size_t > ib::fil::Tablespace_scanning::get_tablespace_page_size |
( |
space_id_t |
space_id | ) |
|
Get the physical page size of a Tablespace given it's space id.
- Parameters
-
| [in] | space_id | Tablespace id |
- Returns
- Tablespace page size if Tablespace with the given id is found, nullopt otherwise
◆ is_cleared()
| bool ib::fil::Tablespace_scanning::is_cleared |
( |
| ) |
|
|
inline |
Returns true if mapping has been cleared.
◆ is_inited()
| bool ib::fil::Tablespace_scanning::is_inited |
( |
| ) |
|
|
inline |
Returns true if mapping has been initialized.
◆ is_known_path()
| bool ib::fil::Tablespace_scanning::is_known_path |
( |
const std::string & |
path | ) |
|
|
inline |
Check if a path is known to InnoDB.
- Parameters
-
- Returns
- true if path is known to InnoDB
◆ is_tablespace_file_found()
| bool ib::fil::Tablespace_scanning::is_tablespace_file_found |
( |
const space_id_t |
space_id | ) |
|
|
inline |
Check if file for a given space_id is found during scan.
- Parameters
-
| [in] | space_id | Tablespace id |
- Returns
- true if file is found, false otherwise.
◆ print_mapping()
| void ib::fil::Tablespace_scanning::print_mapping |
( |
| ) |
|
|
inline |
◆ scan()
| dberr_t ib::fil::Tablespace_scanning::scan |
( |
| ) |
|
|
inline |
Discover tablespaces by reading the header from IBD files.
- Returns
- DB_SUCCESS if all goes well
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & |
stream, |
|
|
const Scanning_state & |
state |
|
) |
| |
|
friend |
◆ m_scanned_dirs
Tablespace directories scanned at startup.
◆ m_state
The documentation for this class was generated from the following files: