2929#include " wsrep/tls_service.hpp"
3030#include " wsrep/allowlist_service.hpp"
3131#include " wsrep/connection_monitor_service.hpp"
32+ #include " wsrep/provider_options.hpp"
3233
3334#include " service_helpers.hpp"
3435#include " thread_service_v1.hpp"
3536#include " tls_service_v1.hpp"
3637#include " allowlist_service_v1.hpp"
3738#include " event_service_v1.hpp"
39+ #include " config_service_v1.hpp"
3840#include " v26/wsrep_api.h"
3941#include " v26/wsrep_node_isolation.h"
4042#include " connection_monitor_service_v1.hpp"
@@ -772,7 +774,7 @@ void wsrep::wsrep_provider_v26::deinit_services()
772774wsrep::wsrep_provider_v26::wsrep_provider_v26 (
773775 wsrep::server_state& server_state,
774776 const std::string& provider_spec,
775- const std::function<std::string()>& provider_options_cb,
777+ const std::function<std::string(provider_options& )>& provider_options_cb,
776778 const wsrep::provider::services& services)
777779 : provider(server_state)
778780 , wsrep_()
@@ -785,14 +787,24 @@ wsrep::wsrep_provider_v26::wsrep_provider_v26(
785787 server_state.initial_position ().id ().data (),
786788 sizeof (state_id.uuid .data ));
787789 state_id.seqno = server_state.initial_position ().seqno ().get ();
790+
791+ if (wsrep_load (provider_spec.c_str (), &wsrep_, logger_cb))
792+ {
793+ throw wsrep::runtime_error (" Failed to load wsrep library" );
794+ }
795+
796+ init_services (services);
797+ provider_options options;
798+ config_service_v1_fetch (wsrep_, &options);
799+
788800 struct wsrep_init_args init_args;
789801 memset (&init_args, 0 , sizeof (init_args));
790802 init_args.app_ctx = &server_state;
791803 init_args.node_name = server_state_.name ().c_str ();
792804 init_args.node_address = server_state_.address ().c_str ();
793805 init_args.node_incoming = server_state_.incoming_address ().c_str ();
794806 init_args.data_dir = server_state_.working_dir ().c_str ();
795- const auto & provider_options = provider_options_cb ();
807+ const auto & provider_options = provider_options_cb (options );
796808 init_args.options = provider_options.c_str ();
797809 init_args.proto_ver = server_state.max_protocol_version ();
798810 init_args.state_id = &state_id;
@@ -807,13 +819,6 @@ wsrep::wsrep_provider_v26::wsrep_provider_v26(
807819 init_args.sst_donate_cb = &sst_donate_cb;
808820 init_args.synced_cb = &synced_cb;
809821
810- if (wsrep_load (provider_spec.c_str (), &wsrep_, logger_cb))
811- {
812- throw wsrep::runtime_error (" Failed to load wsrep library" );
813- }
814-
815- init_services (services);
816-
817822 if (wsrep_->init (wsrep_, &init_args) != WSREP_OK)
818823 {
819824 throw wsrep::runtime_error (" Failed to initialize wsrep provider" );
0 commit comments