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

Read recovered position from sst_received() after initialization

In general the position where the storage recovers after a SST
cannot be known untile the recovery process is over. This in turn
means that the position cannot be known when the server_state
sst_received() method is called. Worked around the problem by
introducing get_position() method into server service which
can be used to get the position from stable storage after SST
has completed and the state has been recovered.
This commit is contained in:
Teemu Ollakka
2019-01-14 13:11:57 +02:00
parent 17fc8c16de
commit 89b3561ad8
8 changed files with 43 additions and 13 deletions

View File

@ -42,6 +42,7 @@ namespace wsrep
, last_client_id_(0)
, last_transaction_id_(0)
, logged_view_()
, position_()
{ }
wsrep::storage_service* storage_service(wsrep::client_service&)
@ -143,6 +144,10 @@ namespace wsrep
return my_view;
}
wsrep::gtid get_position(wsrep::client_service&) WSREP_OVERRIDE
{
return position_;
}
void log_state_change(enum wsrep::server_state::state,
enum wsrep::server_state::state)
{ }
@ -198,11 +203,16 @@ namespace wsrep
{
logged_view_ = view;
}
void position(const wsrep::gtid& position)
{
position_ = position;
}
private:
wsrep::server_state& server_state_;
unsigned long long last_client_id_;
unsigned long long last_transaction_id_;
wsrep::view logged_view_;
wsrep::gtid position_;
};