mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Pass initial position when loading the provider
Having initial position as a part of server_state does not allow restarting the provider from different startup position without either reconstructing server_state or adding setter method for initial position. As the only use for initial_position in server state was to pass it to provider during provider load, it makes more sense to have the initial position to be passed as an argument to server_state load_provider() method.
This commit is contained in:
@ -362,7 +362,8 @@ namespace wsrep
|
||||
static provider* make_provider(
|
||||
wsrep::server_state&,
|
||||
const std::string& provider_spec,
|
||||
const std::string& provider_options);
|
||||
const std::string& provider_options,
|
||||
const wsrep::gtid& initial_position);
|
||||
protected:
|
||||
wsrep::server_state& server_state_;
|
||||
};
|
||||
|
@ -212,11 +212,6 @@ namespace wsrep
|
||||
*/
|
||||
const std::string& working_dir() const { return working_dir_; }
|
||||
|
||||
/**
|
||||
* Return initial position for server.
|
||||
*/
|
||||
const wsrep::gtid& initial_position() const
|
||||
{ return initial_position_; }
|
||||
/**
|
||||
* Return maximum protocol version.
|
||||
*/
|
||||
@ -261,7 +256,8 @@ namespace wsrep
|
||||
* @return Zero on success, non-zero on error.
|
||||
*/
|
||||
int load_provider(const std::string& provider,
|
||||
const std::string& provider_options);
|
||||
const std::string& provider_options,
|
||||
const wsrep::gtid& intial_position);
|
||||
|
||||
void unload_provider();
|
||||
|
||||
@ -557,7 +553,7 @@ namespace wsrep
|
||||
const std::string& incoming_address,
|
||||
const std::string& address,
|
||||
const std::string& working_dir,
|
||||
const wsrep::gtid& initial_position,
|
||||
// const wsrep::gtid& initial_position,
|
||||
int max_protocol_version,
|
||||
enum rollback_mode rollback_mode)
|
||||
: mutex_(mutex)
|
||||
@ -567,7 +563,7 @@ namespace wsrep
|
||||
, state_hist_()
|
||||
, state_waiters_(n_states_)
|
||||
, bootstrap_()
|
||||
, initial_position_(initial_position)
|
||||
// , initial_position_(initial_position)
|
||||
, init_initialized_()
|
||||
, init_synced_()
|
||||
, sst_gtid_()
|
||||
@ -628,7 +624,7 @@ namespace wsrep
|
||||
std::vector<enum state> state_hist_;
|
||||
mutable std::vector<int> state_waiters_;
|
||||
bool bootstrap_;
|
||||
const wsrep::gtid initial_position_;
|
||||
// const wsrep::gtid initial_position_;
|
||||
bool init_initialized_;
|
||||
bool init_synced_;
|
||||
wsrep::gtid sst_gtid_;
|
||||
|
Reference in New Issue
Block a user