mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +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:
@ -128,6 +128,11 @@ wsrep::view db::server_service::get_view(wsrep::client_service&,
|
||||
return my_view;
|
||||
}
|
||||
|
||||
wsrep::gtid db::server_service::get_position(wsrep::client_service&)
|
||||
{
|
||||
throw wsrep::not_implemented_error();
|
||||
}
|
||||
|
||||
void db::server_service::log_state_change(
|
||||
enum wsrep::server_state::state prev_state,
|
||||
enum wsrep::server_state::state current_state)
|
||||
|
@ -50,6 +50,7 @@ namespace db
|
||||
const wsrep::view&) override;
|
||||
wsrep::view get_view(wsrep::client_service&, const wsrep::id&)
|
||||
override;
|
||||
wsrep::gtid get_position(wsrep::client_service&) override;
|
||||
void log_state_change(enum wsrep::server_state::state,
|
||||
enum wsrep::server_state::state) override;
|
||||
int wait_committing_transactions(int) override;
|
||||
|
@ -67,7 +67,7 @@ void db::simulator::sst(db::server& server,
|
||||
db::client dummy(*(i->second), wsrep::client_id(-1),
|
||||
wsrep::client_state::m_local, params());
|
||||
|
||||
i->second->server_state().sst_received(dummy.client_service(), gtid, 0);
|
||||
i->second->server_state().sst_received(dummy.client_service(), 0);
|
||||
server.server_state().sst_sent(gtid, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user