1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Protocol version and connected gtid

* Propagate server max protocol version to provider init options
* Store gtid from connected call to make cluster id and the connect
  position available
This commit is contained in:
Teemu Ollakka
2018-06-26 11:34:05 +03:00
parent bd0ba5b01d
commit 2a53198f5c
7 changed files with 40 additions and 14 deletions

View File

@ -192,6 +192,12 @@ namespace wsrep
* @return String containing path to working directory.
*/
const std::string& working_dir() const { return working_dir_; }
/**
* Return maximum protocol version.
*/
int max_protocol_version() const { return max_protocol_version_;}
/**
* Get the rollback mode which server is operating in.
*
@ -254,7 +260,7 @@ namespace wsrep
* A method which will be called when the server
* has been joined to the cluster
*/
void on_connect();
void on_connect(const wsrep::gtid& gtid);
/**
* A method which will be called when a view
@ -284,6 +290,12 @@ namespace wsrep
wait_until_state(lock, state);
}
/**
* Return GTID at the position when server connected to
* the cluster.
*/
wsrep::gtid connected_gtid() const { return connected_gtid_; }
/**
* Return current view
*/
@ -467,6 +479,7 @@ namespace wsrep
const std::string& id,
const std::string& address,
const std::string& working_dir,
int max_protocol_version,
enum rollback_mode rollback_mode)
: mutex_(mutex)
, cond_(cond)
@ -486,7 +499,9 @@ namespace wsrep
, id_(id)
, address_(address)
, working_dir_(working_dir)
, max_protocol_version_(max_protocol_version)
, rollback_mode_(rollback_mode)
, connected_gtid_()
, current_view_()
, last_committed_gtid_()
, debug_log_level_(0)
@ -521,7 +536,9 @@ namespace wsrep
std::string id_;
std::string address_;
std::string working_dir_;
int max_protocol_version_;
enum rollback_mode rollback_mode_;
wsrep::gtid connected_gtid_;
wsrep::view current_view_;
wsrep::gtid last_committed_gtid_;
int debug_log_level_;

View File

@ -84,6 +84,9 @@ namespace wsrep
ssize_t own_index() const
{ return own_index_; }
int protocol_version() const
{ return protocol_version_; }
const std::vector<member>& members() const { return members_; }
/**