MySQL 8.0.40
Source Code Documentation
cluster_metadata.cc File Reference
#include "cluster_metadata.h"
#include <cstring>
#include <stdexcept>
#include "common.h"
#include "harness_assert.h"
#include "mysql/harness/event_state_tracker.h"
#include "mysql/harness/logging/logging.h"
#include "mysqld_error.h"
#include "mysqlrouter/utils.h"
#include "mysqlrouter/utils_sqlstring.h"
#include "router_config.h"

Namespaces

namespace  mysqlrouter
 
 

Functions

static std::string mysqlrouter::as_string (const char *input_str)
 Return a string representation of the input character string. More...
 
static void mysqlrouter::verify_router_id_is_ours_v1 (const uint32_t router_id, const std::string &hostname_override, MySQLSession *mysql, mysql_harness::SocketOperationsBase *socket_operations)
 
static void mysqlrouter::verify_router_id_is_ours_v2 (const uint32_t router_id, const std::string &hostname_override, MySQLSession *mysql, mysql_harness::SocketOperationsBase *socket_operations)
 
std::string mysqlrouter::anonymous_namespace{cluster_metadata.cc}::to_string_md (const ClusterType cluster_type)
 
void mysqlrouter::anonymous_namespace{cluster_metadata.cc}::update_router_info_v1 (const uint32_t router_id, const std::string &rw_endpoint, const std::string &ro_endpoint, const std::string &rw_x_endpoint, const std::string &ro_x_endpoint, const std::string &username, MySQLSession *mysql)
 
void mysqlrouter::anonymous_namespace{cluster_metadata.cc}::update_router_info_v2 (const mysqlrouter::ClusterType cluster_type, const uint32_t router_id, const std::string &cluster_id, const std::string &target_cluster, const std::string &rw_endpoint, const std::string &ro_endpoint, const std::string &rw_x_endpoint, const std::string &ro_x_endpoint, const std::string &username, MySQLSession *mysql)
 
uint32_t mysqlrouter::anonymous_namespace{cluster_metadata.cc}::register_router_v1 (const std::string &router_name, const bool overwrite, const std::string &hostname_override, MySQLSession *mysql, mysql_harness::SocketOperationsBase *socket_operations)
 
uint32_t mysqlrouter::anonymous_namespace{cluster_metadata.cc}::register_router_v2 (const std::string &router_name, const bool overwrite, const std::string &hostname_override, MySQLSession *mysql, mysql_harness::SocketOperationsBase *socket_operations)
 
bool ROUTER_LIB_EXPORT mysqlrouter::metadata_schema_version_is_compatible (const mysqlrouter::MetadataSchemaVersion &required, const mysqlrouter::MetadataSchemaVersion &available)
 
bool ROUTER_LIB_EXPORT mysqlrouter::metadata_schema_version_is_deprecated (const mysqlrouter::MetadataSchemaVersion &version)
 
std::string ROUTER_LIB_EXPORT mysqlrouter::get_metadata_schema_deprecated_msg (const mysqlrouter::MetadataSchemaVersion &version)
 
std::string ROUTER_LIB_EXPORT mysqlrouter::to_string (const MetadataSchemaVersion &version)
 
MetadataSchemaVersion ROUTER_LIB_EXPORT mysqlrouter::get_metadata_schema_version (MySQLSession *mysql)
 
bool ROUTER_LIB_EXPORT mysqlrouter::check_group_replication_online (MySQLSession *mysql)
 
bool ROUTER_LIB_EXPORT mysqlrouter::check_group_has_quorum (MySQLSession *mysql)
 
static uint64_t mysqlrouter::query_gr_cluster_count (MySQLSession *mysql, const bool metadata_v2)
 
static ClusterInfo mysqlrouter::query_metadata_servers (MySQLSession *mysql, const mysqlrouter::ClusterType cluster_type)
 
static std::vector< std::string > mysqlrouter::do_get_routing_mode_queries (MySQLSession *mysql, const bool metadata_v2)
 
static ClusterType mysqlrouter::get_cluster_type (MySQLSession *mysql)
 
bool ROUTER_LIB_EXPORT mysqlrouter::is_part_of_cluster_set (MySQLSession *mysql)
 
static bool mysqlrouter::was_bootstrapped_as_clusterset (MySQLSession *mysql, const unsigned router_id)
 
ClusterType ROUTER_LIB_EXPORT mysqlrouter::get_cluster_type (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, unsigned int router_id=0)
 
std::unique_ptr< ClusterMetadatamysqlrouter::create_metadata (const MetadataSchemaVersion &schema_version, MySQLSession *mysql, const OptionsMap &options, mysql_harness::SocketOperationsBase *sockops)
 
std::string ROUTER_LIB_EXPORT mysqlrouter::to_string (const ClusterType cluster_type)
 
static std::vector< std::string > mysqlrouter::get_grant_statements_v1 (const std::string &new_accounts)
 
static std::vector< std::string > mysqlrouter::get_grant_statements_v2 (const std::string &new_accounts)
 
stdx::expected< void, std::string > ROUTER_LIB_EXPORT mysqlrouter::setup_metadata_session (MySQLSession &session)
 

Variables

static constexpr const std::string_view kClusterSet {"clusterset"}
 
static constexpr const std::string_view kCreateClusterUrl
 
constexpr const char * mysqlrouter::kDefaultSqlMode
 

Variable Documentation

◆ kClusterSet

constexpr const std::string_view kClusterSet {"clusterset"}
staticconstexpr

◆ kCreateClusterUrl

constexpr const std::string_view kCreateClusterUrl
staticconstexpr
Initial value:
{
"https://dev.mysql.com/doc/mysql-shell/en/"
"deploying-production-innodb-cluster.html"}