|
| GRClusterSetMetadataBackend (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
mysqlrouter::ClusterType | get_cluster_type () override |
|
stdx::expected< metadata_cache::ClusterTopology, std::error_code > | fetch_cluster_topology (MySQLSession::Transaction &transaction, mysqlrouter::TargetCluster &target_cluster, const metadata_cache::metadata_server_t &metadata_server, const metadata_cache::metadata_servers_list_t &metadata_servers, bool needs_writable_node, const RouterOptions &router_options, const std::string &clusterset_id="", bool whole_topology=false) override |
| Returns cluster defined in the metadata given set of the metadata servers (cluster members) More...
|
|
void | reset () override |
|
std::vector< metadata_cache::metadata_servers_list_t > | get_metadata_servers (const metadata_cache::metadata_servers_list_t &metadata_servers) override |
|
| GRMetadataBackendV2 (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
metadata_cache::ClusterTopology | fetch_instances_from_metadata_server (const mysqlrouter::TargetCluster &target_cluster, const std::string &clusterset_id="") override |
| Queries the metadata server for the list of instances that belong to the desired cluster. More...
|
|
| GRMetadataBackend (GRClusterMetadata *metadata, ConnectCallback &connect_clb) |
|
virtual | ~GRMetadataBackend () |
|
|
metadata_cache::cluster_nodes_list_t | fetch_target_cluster_instances_from_metadata_server (mysqlrouter::MySQLSession &session, const std::string &cluster_id) |
| Returns vector of the cluster members according to the metadata of the selected server. More...
|
|
std::tuple< std::string, std::string, mysqlrouter::TargetCluster > | get_target_cluster_info_from_metadata_server (mysqlrouter::MySQLSession &session, const mysqlrouter::TargetCluster &target_cluster, const std::string &clusterset_id) |
|
metadata_cache::ClusterTopology | update_clusterset_topology_from_metadata_server (mysqlrouter::MySQLSession &session, const std::string &clusterset_id, uint64_t view_id) |
| Queries the metada for the current ClusterSet topology. More...
|
|
void | update_clusterset_status_from_gr (metadata_cache::ClusterTopology &cs_topology, bool needs_writable_node, bool whole_topology, const RouterOptions &router_options, const metadata_cache::metadata_servers_list_t &metadata_servers) |
| Given the topology read from metadata updates the topology with the current status from GR tables. More...
|
|
std::optional< metadata_cache::metadata_server_t > | find_rw_server () |
| Finds the writable node within the currently known ClusterSet topology. More...
|
|
|
static void | update_metadata_servers_list (metadata_cache::ClusterTopology &cs_topology) |
| Given the topology read from the metadata and updated with the current staus from the GR tables updates the metadata_servers list putting them in the following order: 1) Primary Node of Primary Cluster 2) Secondary Nodes of Primary Cluster 3) Nodes of Secondary Clusters starting with Primary Node for each. More...
|
|
◆ GRClusterSetMetadataBackend()
◆ fetch_cluster_topology()
Returns cluster defined in the metadata given set of the metadata servers (cluster members)
- Parameters
-
| transaction | transaction to be used for SQL queries required by this function |
[in,out] | target_cluster | object identifying the Cluster this operation refers to |
| metadata_server | info about the metadata server we are querying |
| metadata_servers | set of all the metadata servers read during the bootstrap or the last metadata refresh, sorted by the staus of the cluster and status of the node in the cluster (Primary first) |
| needs_writable_node | flag indicating if the caller needs us to query for writable node |
| router_options | options configured for this Router in the metadata |
| clusterset_id | UUID of the ClusterSet the Cluster belongs to (if bootstrapped as a ClusterSet) |
| whole_topology | return all usable nodes, ignore potential metadata filters or policies (like target_cluster etc.) |
- Returns
- object containing cluster topology information in case of success, or error code in case of failure
- Exceptions
-
metadata_cache::metadata_error | |
Reimplemented from GRMetadataBackend.
◆ fetch_target_cluster_instances_from_metadata_server()
Returns vector of the cluster members according to the metadata of the selected server.
- Parameters
-
session | active connection to the member that is checked for the metadata |
cluster_id | ID of the cluster this operation refers to |
- Returns
- vector of the cluster members
◆ find_rw_server()
Finds the writable node within the currently known ClusterSet topology.
- Returns
- address of the current primary node if found
-
std::nullopt if did not find any writable node primary
◆ get_cluster_type()
◆ get_metadata_servers()
◆ get_target_cluster_info_from_metadata_server()
◆ reset()
void GRClusterSetMetadataBackend::reset |
( |
| ) |
|
|
inlineoverridevirtual |
◆ update_clusterset_status_from_gr()
Given the topology read from metadata updates the topology with the current status from GR tables.
- Parameters
-
cs_topology | ClusterSet topology as read from the metadata server |
needs_writable_node | flag indicating if the caller needs us to query for writable node |
whole_topology | return all usable nodes, ignore potential metadata filters or policies (like target_cluster etc.) |
router_options | options configured for this Router in the metadata |
metadata_servers | the list of ClusterSet metadata servers |
◆ update_clusterset_topology_from_metadata_server()
Queries the metada for the current ClusterSet topology.
Stores the topology in the class state. Returns the set of the metadata server for the ClusterSet.
- Parameters
-
session | active connection to the member that is checked for the metadata |
clusterset_id | ID of the ClusterSet this operation refers to |
view_id | view id of the metadata |
- Returns
- set of the servers that contains metadata for the ClusterSet
◆ update_metadata_servers_list()
Given the topology read from the metadata and updated with the current staus from the GR tables updates the metadata_servers list putting them in the following order: 1) Primary Node of Primary Cluster 2) Secondary Nodes of Primary Cluster 3) Nodes of Secondary Clusters starting with Primary Node for each.
- Parameters
-
cs_topology | ClusterSet topology |
◆ cluster_topology_
◆ metadata_read_
bool GRClusterSetMetadataBackend::metadata_read_ {false} |
|
private |
◆ view_id_
uint64_t GRClusterSetMetadataBackend::view_id_ {0} |
|
private |
The documentation for this class was generated from the following file: