MySQL 8.4.2
Source Code Documentation
Validate_files Class Reference

Validate the DD tablespace data against what's read during the directory scan on startup. More...

Public Member Functions

 Validate_files ()
 Constructor. More...
 
dberr_t validate (const DD_tablespaces &tablespaces)
 Validate the discovered tablespaces against the DD and attempt to open any DD tablespace not already open using a Parallel For Loop (par_for). More...
 

Private Types

using DD_tablespaces = std::vector< const dd::Tablespace * >
 
using Const_iter = DD_tablespaces::const_iterator
 

Private Member Functions

void check (const Const_iter &begin, const Const_iter &end, size_t thread_id)
 Validate a range of tablespaces from the DD. More...
 
bool failed () const
 
space_id_t get_space_max_id () const
 

Private Attributes

std::atomic< space_id_tm_space_max_id
 Maximum tablespace ID found. More...
 
size_t m_n_to_check
 Number of tablespaces to check. More...
 
size_t m_n_threads
 Number of threads used in the parallel for. More...
 
std::atomic< std::chrono::steady_clock::time_point > m_start_time
 The time when Validate_files::validate() starts or the last time one of the threads reported progress. More...
 
std::atomic_size_t m_n_validated
 Number of tablespaces validated. More...
 
std::atomic_size_t m_n_skipped
 Number of tablespaces skipped. More...
 
std::atomic_size_t m_n_moved
 Number of tablespaces moved. More...
 
std::atomic_size_t m_n_missing
 Number of tablespaces missing. More...
 
std::atomic_size_t m_n_deleted
 Number of tablespaces deleted. More...
 
std::atomic_size_t m_n_errors
 Number of threads that failed. More...
 

Detailed Description

Validate the DD tablespace data against what's read during the directory scan on startup.

Member Typedef Documentation

◆ Const_iter

using Validate_files::Const_iter = DD_tablespaces::const_iterator
private

◆ DD_tablespaces

using Validate_files::DD_tablespaces = std::vector<const dd::Tablespace *>
private

Constructor & Destructor Documentation

◆ Validate_files()

Validate_files::Validate_files ( )
inline

Constructor.

Member Function Documentation

◆ check()

void Validate_files::check ( const Const_iter begin,
const Const_iter end,
size_t  thread_id 
)
private

Validate a range of tablespaces from the DD.

  1. Compare the discovered files against those known to the dictionary.
  2. Open any tablespace known to the DD but not discovered and opened from the known directories.
  3. Update the DD if a tablespace has moved.
  4. Update the DD if an undo tablespace was truncated and replaced.
  5. If innodb_validate_tablespace_paths is set and this is not called while in recovery, only validate undo tablespaces.
  6. Track the number of skipped, moved, missing and deleted tablespaces.
  7. Return failure for any unexpected error.
    Parameters
    [in]beginStart of the slice
    [in]endEnd of the slice
    [in]thread_idThread ID

◆ failed()

bool Validate_files::failed ( ) const
inlineprivate
Returns
true if there were failures.

◆ get_space_max_id()

space_id_t Validate_files::get_space_max_id ( ) const
inlineprivate
Returns
the maximum tablespace ID found.

◆ validate()

dberr_t Validate_files::validate ( const DD_tablespaces tablespaces)

Validate the discovered tablespaces against the DD and attempt to open any DD tablespace not already open using a Parallel For Loop (par_for).

Parameters
[in]tablespacesTablespace files read from the DD
Returns
DB_SUCCESS if all OK

Member Data Documentation

◆ m_n_deleted

std::atomic_size_t Validate_files::m_n_deleted
private

Number of tablespaces deleted.

◆ m_n_errors

std::atomic_size_t Validate_files::m_n_errors
private

Number of threads that failed.

◆ m_n_missing

std::atomic_size_t Validate_files::m_n_missing
private

Number of tablespaces missing.

◆ m_n_moved

std::atomic_size_t Validate_files::m_n_moved
private

Number of tablespaces moved.

◆ m_n_skipped

std::atomic_size_t Validate_files::m_n_skipped
private

Number of tablespaces skipped.

◆ m_n_threads

size_t Validate_files::m_n_threads
private

Number of threads used in the parallel for.

◆ m_n_to_check

size_t Validate_files::m_n_to_check
private

Number of tablespaces to check.

◆ m_n_validated

std::atomic_size_t Validate_files::m_n_validated
private

Number of tablespaces validated.

◆ m_space_max_id

std::atomic<space_id_t> Validate_files::m_space_max_id
private

Maximum tablespace ID found.

◆ m_start_time

std::atomic<std::chrono::steady_clock::time_point> Validate_files::m_start_time
private

The time when Validate_files::validate() starts or the last time one of the threads reported progress.


The documentation for this class was generated from the following file: