![]() |
MySQL 26.10.0
Source Code Documentation
|
Owns and controls the embedded MRS backend lifecycle. More...
#include <mrs_component_backend.h>
Public Member Functions | |
| Backend ()=default | |
| ~Backend () override=default | |
| Backend (const Backend &src)=delete | |
| Backend (Backend &&src)=delete | |
| Backend & | operator= (const Backend &src)=delete |
| Backend & | operator= (Backend &&src)=delete |
| void | enable_lifecycle_operations () |
| int | start (AccountProvisioning account_provisioning) |
| int | restart () |
| int | stop () |
| int | shutdown () |
| const char * | lifecycle_state_name () const |
| CurrentSecurityCtx | get_current_sec_ctx () const |
Private Types | |
| enum class | LifecycleState : std::uint8_t { kStopped , kStarting , kWaitingForMetadata , kReady , kStopping , kError } |
Private Member Functions | |
| int | start_backend (AccountProvisioning account_provisioning) |
| int | stop_backend () |
| void | log_disabled_lifecycle_operation_rejection (const char *operation) const |
| void | report_waiting_for_metadata () |
| void | report_metadata_ready () |
| void | report_backend_error () |
| mrs::MrsStartResult | on_mrs_start () override |
| void | fetch_current_sec_ctx () |
| bool | provision_accounts (bool ignore_missing_provider_role_error) const |
| void | configure_accounts (bool retry_account_provisioning, bool validate_metadata_account) |
| uint64_t | populate_mrs_metadata () const |
| void | reset_process_state_component () const |
| void | setup_logger (mysql_harness::DIM &dim) const |
| void | configure_loader (mysql_harness::DIM &dim) const |
| void | install_embedded_runtime_integration () |
| void | reset_embedded_runtime_integration () |
| void | breakable_sleep (std::chrono::seconds duration) const |
| bool | wait_for_metadata_schema (const std::string &user, const std::string &host, bool validate_metadata_account) |
| void | run (std::promise< int > p, bool has_bootstrap_context) |
| mysql_harness::DIM & | init_DIM () |
| void | init_builtins () |
Private Member Functions inherited from mrs::MrsStartObserver | |
| virtual | ~MrsStartObserver ()=default |
Private Attributes | |
| RouterConfig | m_router_config |
| LogLevel | m_log_level {LogLevel::ERROR} |
| mysql_harness::logging::DomainLogger | m_logger |
| std::mutex | m_lifecycle_operation_mtx |
| std::mutex | m_lifecycle_state_mtx |
| LifecycleState | m_lifecycle_state {LifecycleState::kStopped} |
| bool | m_lifecycle_admission_open {false} |
| std::mutex | m_loader_create_mtx |
| std::unique_ptr< mysql_harness::Loader > | m_loader |
| std::unique_ptr< ComponentEmbeddedRuntimeServices > | m_embedded_runtime_services |
| std::thread | m_service_thread |
| std::thread | m_backend_starter_thread |
| std::atomic< bool > | m_backend_thd_stop_requested {false} |
| std::optional< CurrentSecurityCtx > | m_deferred_account_provisioning_context |
| bool | m_debug_pause_before_account_provisioning {false} |
| bool | m_debug_pause_before_runtime_status_publication {false} |
| std::atomic< bool > | m_debug_resume_runtime_status_publication {false} |
| CurrentSecurityCtx | m_sec_ctx |
Owns and controls the embedded MRS backend lifecycle.
|
strongprivate |
|
default |
|
overridedefault |
|
delete |
|
delete |
|
private |
|
private |
|
private |
Due to BUG#38080803 we need to validate the value of bind_address:
| void mrs_component::Backend::enable_lifecycle_operations | ( | ) |
|
private |
|
inline |
|
private |
|
private |
|
private |
| const char * mrs_component::Backend::lifecycle_state_name | ( | ) | const |
|
private |
|
overrideprivatevirtual |
Implements mrs::MrsStartObserver.
|
private |
Check if the entry already exists in the Metadata first, because for example the component was restarted, and if so, obtain it's ID. If the router does not exist yet we need to "bootstrap" it and insert a new entry in the table.
Info:
router_name = "@@hostname":"http_port" address = "@@hostname" product_name = "MySQL Rest Service Component" version = current attributes = {"server_uuid": "@@server_uuid", "mrs_metadata_accounts": metadata_account, "mrs_data_accounts": data_account} options = {}
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| int mrs_component::Backend::restart | ( | ) |
|
private |
|
private |
| int mrs_component::Backend::shutdown | ( | ) |
| int mrs_component::Backend::start | ( | AccountProvisioning | account_provisioning | ) |
|
private |
Set the local_address:
1) Prefer socket if available: fetch the socket full path 2) Fallback to 127.0.0.1 otherwise.
On Windows, support for named_pipes is not available we need to fallback to tcp/ip.
| int mrs_component::Backend::stop | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |