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

Undefined server id in convert_streaming_client_to_applier()

Method wsrep::server_state::convert_streaming_client_to_applier() may
insert an entry in streaming_appliers_ map which contains undefined
server_id. This happens if the method is called while in non-primary
state, and server_state::id_ is undefined.
The fix is to use the server_id which is recorded in client's
tansaction object.
This commit is contained in:
Daniele Sciascia
2018-12-03 22:36:24 +01:00
parent fd07ff12e4
commit 8f490d431a

View File

@ -878,7 +878,8 @@ void wsrep::server_state::convert_streaming_client_to_applier(
streaming_applier->adopt_transaction(client_state->transaction());
if (streaming_appliers_.insert(
std::make_pair(
std::make_pair(id_, client_state->transaction().id()),
std::make_pair(client_state->transaction().server_id(),
client_state->transaction().id()),
streaming_applier)).second == false)
{
wsrep::log_warning() << "Could not insert streaming applier "
@ -1110,10 +1111,12 @@ void wsrep::server_state::close_orphaned_sr_transactions(
wsrep::gtid(),
wsrep::stid(server_id, transaction_id, wsrep::client_id()),
wsrep::seqno::undefined(), 0);
lock.unlock();
high_priority_service.remove_fragments(ws_meta);
high_priority_service.commit(wsrep::ws_handle(transaction_id, 0),
ws_meta);
high_priority_service.after_apply();
lock.lock();
}
else
{