#include <rpl_info_factory.h>
|
static bool | create_slave_info_objects (uint mi_option, uint rli_option, int thread_mask, Multisource_info *pchannel_map) |
| This function should be called from init_replica() only. More...
|
|
static bool | configure_channel_replication_filters (Relay_log_info *rli, const char *channel_name) |
| Establish the relation between the channel's replication filters and the channel's Relay_log_info, and copy global replication filters to the channel's replication filters if needed. More...
|
|
static Master_info * | create_mi_and_rli_objects (uint mi_option, uint rli_option, const char *channel, Multisource_info *channel_map) |
| Create Master_info and Relay_log_info objects for a new channel. More...
|
|
static Master_info * | create_mi (uint rli_option, const char *channel) |
| Creates a Master info repository whose type is defined as a parameter. More...
|
|
static Relay_log_info * | create_rli (uint rli_option, bool is_slave_recovery, const char *channel) |
| Creates a Relay log info repository whose type is defined as a parameter. More...
|
|
static Slave_worker * | create_worker (uint rli_option, uint worker_id, Relay_log_info *rli, bool is_gaps_collecting_phase) |
| Creates a Slave worker repository whose type is defined as a parameter. More...
|
|
static bool | reset_workers (Relay_log_info *rli) |
| Delete all info from Worker info tables to render them useless in future MTS recovery, and indicate that in Coordinator info table. More...
|
|
static void | invalidate_repository_position (Master_info *mi) |
| If GTID_ONLY is set for this channel, receiver and applier positions will be marked as invalid. More...
|
|
|
static void | init_repository_metadata () |
| Initializes startup information on different repositories. More...
|
|
static bool | init_repository (const struct_table_data &table_data, uint option, Rpl_info_handler **handler) |
| Creates repositories that will be associated to either the Master_info or Relay_log_info. More...
|
|
static bool | init_repository (Rpl_info *info, Rpl_info_handler **handler) |
| This method is used to initialize the repositories through a low-level interface, which means that if they do not exist nothing will be created. More...
|
|
static bool | scan_and_count_repositories (ulonglong &found_instances, uint &found_rep_option, const struct_table_data &table_data) |
| Scan table for repositories. More...
|
|
static bool | scan_and_check_repositories (uint &found_rep_option, const struct_table_data &table_data) |
| Scan table for repositories. More...
|
|
static bool | load_channel_names_from_repository (std::vector< std::string > &channel_list, uint mi_instances, uint mi_repository, const char *default_channel, bool *default_channel_created_previously) |
| Make a list of any channels that may have existed on the previous slave run. More...
|
|
static bool | load_channel_names_from_table (std::vector< std::string > &channel_list, const char *default_channel, bool *default_channel_created_previously) |
| In a multisourced slave, during init_replica(), the repositories are read to initialize the slave info objects. More...
|
|
◆ struct_table_data
◆ configure_channel_replication_filters()
bool Rpl_info_factory::configure_channel_replication_filters |
( |
Relay_log_info * |
rli, |
|
|
const char * |
channel_name |
|
) |
| |
|
static |
Establish the relation between the channel's replication filters and the channel's Relay_log_info, and copy global replication filters to the channel's replication filters if needed.
- Parameters
-
rli | Pointer to Relay_log_info. |
channel_name | The channel name. |
- Return values
-
false | No error |
true | Failure |
◆ create_mi()
Master_info * Rpl_info_factory::create_mi |
( |
uint |
mi_option, |
|
|
const char * |
channel |
|
) |
| |
|
static |
Creates a Master info repository whose type is defined as a parameter.
- Parameters
-
[in] | mi_option | Type of the repository, e.g. TABLE. |
[in] | channel | the channel for which mi is to be created |
The execution fails if a user requests a type but a different type already exists in the system. This is done to avoid that a user accidentally accesses the wrong repository and makes the slave go out of sync.
- Return values
-
Pointer | to Master_info Success |
NULL | Failure |
◆ create_mi_and_rli_objects()
Master_info * Rpl_info_factory::create_mi_and_rli_objects |
( |
uint |
mi_option, |
|
|
uint |
rli_option, |
|
|
const char * |
channel, |
|
|
Multisource_info * |
pchannel_map |
|
) |
| |
|
static |
Create Master_info and Relay_log_info objects for a new channel.
Also, set cross dependencies between these objects used all over the code.
Both master_info and relay_log_info repositories should be of the type TABLE. We do a check for this here as well.
- Parameters
-
[in] | mi_option | master info repository |
[in] | rli_option | relay log info repository |
[in] | channel | the channel for which these objects should be created. |
[in] | pchannel_map | a pointer to channel_map |
- Returns
- Pointer pointer to the created Master_info
-
NULL when creation fails
◆ create_rli()
Relay_log_info * Rpl_info_factory::create_rli |
( |
uint |
rli_option, |
|
|
bool |
is_slave_recovery, |
|
|
const char * |
channel |
|
) |
| |
|
static |
Creates a Relay log info repository whose type is defined as a parameter.
- Parameters
-
[in] | rli_option | Type of the Relay log info repository |
[in] | is_slave_recovery | If the slave should try to start a recovery process to get consistent relay log files |
[in] | channel | the channel for which mi is to be created |
The execution fails if a user requests a type but a different type already exists in the system. This is done to avoid that a user accidentally accesses the wrong repository and make the slave go out of sync.
- Return values
-
Pointer | to Relay_log_info Success |
NULL | Failure |
◆ create_slave_info_objects()
bool Rpl_info_factory::create_slave_info_objects |
( |
uint |
mi_option, |
|
|
uint |
rli_option, |
|
|
int |
thread_mask, |
|
|
Multisource_info * |
pchannel_map |
|
) |
| |
|
static |
This function should be called from init_replica() only.
During the server start, read all the replica repositories on disk and create corresponding Relay_log_info slave info objects. Each thus created object is added to pchannel_map.
In a new server, an empty-named channel for a replica-source connection is created by default. If there are multiple 'named' channels, but and if a default_channel is not created, it is created.
- Note
- : In general, the algorithm in creation of slave info object is: l1: new slave_info; l2: Initialize the repository handlers l3: if (default_channel) check and convert repositories else TABLE type repository set the value of PK in the TABLE handler.
- Parameters
-
[in] | mi_option | the user provided repository type for MI |
[in] | rli_option | the user provided repository type for RLI |
[in] | thread_mask | thread mask |
[in] | pchannel_map | the pointer to the multi source map (see, rpl_msr.h) |
- Return values
-
◆ create_worker()
Slave_worker * Rpl_info_factory::create_worker |
( |
uint |
rli_option, |
|
|
uint |
worker_id, |
|
|
Relay_log_info * |
rli, |
|
|
bool |
is_gaps_collecting_phase |
|
) |
| |
|
static |
Creates a Slave worker repository whose type is defined as a parameter.
- Parameters
-
[in] | rli_option | Type of the repository, e.g. TABLE. |
[in] | worker_id | ID of the worker to be created. |
[in] | rli | Pointer to Relay_log_info. |
[in] | is_gaps_collecting_phase | See Slave_worker::rli_init_info |
The execution fails if a user requests a type but a different type already exists in the system. This is done to avoid that a user accidentally accesses the wrong repository and make the slave go out of sync.
- Return values
-
Pointer | to Slave_worker Success |
NULL | Failure |
◆ init_repository() [1/2]
Creates repositories that will be associated to either the Master_info or Relay_log_info.
- Parameters
-
[in] | table_data | Defines information to create a table repository. |
[in] | rep_option | Identifies the type of the repository that will be used, i.e., destination repository. |
[out] | handler | Destination repository |
- Return values
-
false | No error |
true | Failure |
◆ init_repository() [2/2]
This method is used to initialize the repositories through a low-level interface, which means that if they do not exist nothing will be created.
- Parameters
-
[in] | info | Either master info or relay log info. |
[out] | handler | Repository handler |
- Return values
-
false | No error |
true | Failure |
◆ init_repository_metadata()
void Rpl_info_factory::init_repository_metadata |
( |
| ) |
|
|
staticprivate |
Initializes startup information on different repositories.
◆ invalidate_repository_position()
void Rpl_info_factory::invalidate_repository_position |
( |
Master_info * |
mi | ) |
|
|
static |
If GTID_ONLY is set for this channel, receiver and applier positions will be marked as invalid.
- Parameters
-
mi | the repository info object whose positions will be invalidated |
◆ load_channel_names_from_repository()
bool Rpl_info_factory::load_channel_names_from_repository |
( |
std::vector< std::string > & |
channel_list, |
|
|
uint |
mi_instances, |
|
|
uint |
mi_repository, |
|
|
const char * |
default_channel, |
|
|
bool * |
default_channel_existed_previously |
|
) |
| |
|
staticprivate |
Make a list of any channels that may have existed on the previous slave run.
- Parameters
-
[out] | channel_list | the names of all channels that exist on this slave. |
[in] | mi_instances | number of master_info repositories |
[in] | mi_repository | Found master_info repository |
[in] | default_channel | pointer to default channel. |
[out] | default_channel_existed_previously | Value filled with true if default channel existed previously. False if it is not. |
- Return values
-
◆ load_channel_names_from_table()
bool Rpl_info_factory::load_channel_names_from_table |
( |
std::vector< std::string > & |
channel_list, |
|
|
const char * |
default_channel, |
|
|
bool * |
default_channel_existed_previously |
|
) |
| |
|
staticprivate |
In a multisourced slave, during init_replica(), the repositories are read to initialize the slave info objects.
To initialize the slave info objects, we need the number of channels the slave was connected to previously. The following function, finds the number of channels in the master info repository. Later, this chanenl list is used to create a pair of {mi, rli} objects required for IO and SQL threads respectively.
- Parameters
-
[out] | channel_list | A reference to the channel list. This will be filled after reading the master info table, row by row. |
[in] | default_channel | pointer to default channel. |
[out] | default_channel_existed_previously | Value filled with true if default channel existed previously. False if it is not. |
◆ reset_workers()
Delete all info from Worker info tables to render them useless in future MTS recovery, and indicate that in Coordinator info table.
- Return values
-
false | on success |
true | when a failure in deletion or writing to Coordinator table fails. |
◆ scan_and_check_repositories()
bool Rpl_info_factory::scan_and_check_repositories |
( |
uint & |
found_rep_option, |
|
|
const struct_table_data & |
table_data |
|
) |
| |
|
staticprivate |
Scan table for repositories.
This method does not try to count the number of repositories, only checks if they are present
- Parameters
-
[out] | found_rep_option | what is the type of repo found |
[in] | table_data | the data on the tables to scan |
- Returns
- true if an error occurs, false otherwise
◆ scan_and_count_repositories()
bool Rpl_info_factory::scan_and_count_repositories |
( |
ulonglong & |
found_instances, |
|
|
uint & |
found_rep_option, |
|
|
const struct_table_data & |
table_data |
|
) |
| |
|
staticprivate |
Scan table for repositories.
This method returns the number of repository instances found which might imply a table scan.
- Parameters
-
[out] | found_instances | the number of repo instances found |
[out] | found_rep_option | what is the type of repo found |
[in] | table_data | the data on the tables to scan |
- Returns
- true if an error occurs, false otherwise
◆ mi_table_data
◆ rli_table_data
◆ worker_table_data
The documentation for this class was generated from the following files: