Directories scanned during startup and the files discovered.
More...
#include <fil0tablespace_scan.h>
Directories scanned during startup and the files discovered.
◆ Const_iter
◆ Result
◆ Scanned_dirs_and_files
first=dir path from the user, second=files found under first.
◆ Scanned_tablespace_dirs()
| ib::fil::Scanned_tablespace_dirs::Scanned_tablespace_dirs |
( |
| ) |
|
|
inline |
◆ add_path()
| void ib::fil::Scanned_tablespace_dirs::add_path |
( |
const std::string & |
str | ) |
|
|
private |
Add a single path specification to this list of tablespace directories.
Convert it to an absolute path. Check if the path is valid. Ignore unreadable, duplicate or invalid directories.
- Parameters
-
| [in] | str | Path specification to tokenize |
◆ add_paths()
| void ib::fil::Scanned_tablespace_dirs::add_paths |
( |
const std::string & |
str, |
|
|
const std::string & |
delimiters |
|
) |
| |
|
private |
Add a delimited list of path specifications to this list of tablespace directories.
Convert relative paths to absolute paths. Check if the paths are valid. Ignore unreadable, duplicate or invalid directories.
- Parameters
-
| [in] | str | Path specification to tokenize |
| [in] | delimiters | Delimiters |
◆ add_scan_dir()
| void ib::fil::Scanned_tablespace_dirs::add_scan_dir |
( |
const std::string & |
directory | ) |
|
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::Scanned_tablespace_dirs::add_scan_dirs |
( |
const std::string & |
directories | ) |
|
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 |
◆ clear()
| void ib::fil::Scanned_tablespace_dirs::clear |
( |
| ) |
|
|
inline |
Clear all the tablespace file data but leave the list of scanned directories in place.
◆ contains()
| bool ib::fil::Scanned_tablespace_dirs::contains |
( |
const std::string & |
path | ) |
const |
|
inline |
Determine if this Fil_path contains the path provided.
- Parameters
-
| [in] | path | file or directory path to compare. |
- Returns
- true if this Fil_path contains path
◆ duplicate_check()
Check for duplicate tablespace IDs.
- Parameters
-
| [in] | start | Start of slice |
| [in] | end | End of slice |
| [in] | thread_id | Thread ID |
| [in,out] | mutex | Mutex protecting the global state |
| [in,out] | unique | To check for duplicates |
| [in,out] | duplicates | Duplicate space IDs found |
◆ erase_path()
| bool ib::fil::Scanned_tablespace_dirs::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
◆ find_by_id()
◆ get_dirs()
| std::string ib::fil::Scanned_tablespace_dirs::get_dirs |
( |
| ) |
const |
|
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::Scanned_tablespace_dirs::get_found_space_ids |
( |
std::vector< space_id_t > & |
space_ids | ) |
|
|
inline |
Get the list of tablespace IDs discovered.
- Parameters
-
| [out] | space_ids | List of tablespace ids |
◆ get_tablespace_info()
Get the tablespace ID from an .ibd and/or an undo tablespace.
If the read failed or the ID is 0 on the first page or there is a mismatch of space_ids stored in FSP_SPACE_ID and FIL_PAGE_SPACE_ID, then try finding the ID with get_tablespace_info_heavy(). This function should only be called during server startup.
- Parameters
-
| [in] | filename | File name to check |
- Returns
- s_invalid_space_id if not found, otherwise the space ID
◆ get_tablespace_info_heavy()
If normal file read isn't sufficient to get the space id and page size, use this heavy method which opens files by guessing different page sizes and read pages from file to determine space_id.
◆ print_duplicates()
| void ib::fil::Scanned_tablespace_dirs::print_duplicates |
( |
const Space_id_set & |
duplicates | ) |
|
|
private |
Print the duplicate filenames for a tablespace ID to the log.
- Parameters
-
| [in] | duplicates | Duplicate tablespace IDs |
◆ print_mapping()
| void ib::fil::Scanned_tablespace_dirs::print_mapping |
( |
| ) |
|
|
inline |
◆ scan()
| dberr_t ib::fil::Scanned_tablespace_dirs::scan |
( |
| ) |
|
Discover tablespaces by reading the header from IBD files.
- Returns
- DB_SUCCESS if all goes well
◆ warn_ignore()
| void ib::fil::Scanned_tablespace_dirs::warn_ignore |
( |
std::string |
path_in, |
|
|
const char * |
reason |
|
) |
| |
|
private |
Report a warning that a path is being ignored and include the reason.
◆ m_checked
| std::atomic_size_t ib::fil::Scanned_tablespace_dirs::m_checked |
|
private |
◆ m_partition_file_names_upgrader
An object to handle partition file names during upgrade.
◆ m_scanned_dirs_and_files
Directories scanned and the files discovered under them.
The documentation for this class was generated from the following files: