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

Interface changes required to store and remove fragments from high

priority context.
This commit is contained in:
Teemu Ollakka
2018-07-09 18:12:48 +03:00
parent 958a916b25
commit 6f68c70d37
10 changed files with 85 additions and 26 deletions

View File

@ -42,7 +42,7 @@ namespace
{
ret = 1;
}
else if (high_priority_service.apply_write_set(data))
else if (high_priority_service.apply_write_set(ws_meta, data))
{
ret = 1;
}
@ -68,10 +68,11 @@ namespace
sa->start_transaction(ws_handle, ws_meta);
{
wsrep::high_priority_switch sw(high_priority_service, *sa);
sa->apply_write_set(data);
sa->apply_write_set(ws_meta, data);
sa->after_apply();
}
high_priority_service.log_dummy_write_set(ws_handle, ws_meta);
high_priority_service.append_fragment_and_commit(ws_handle, ws_meta, data);
high_priority_service.after_apply();
}
else if (ws_meta.flags() == 0)
{
@ -92,17 +93,22 @@ namespace
else
{
wsrep::high_priority_switch sw(high_priority_service, *sa);
ret = sa->apply_write_set(data);
ret = sa->apply_write_set(ws_meta, data);
sa->after_apply();
}
high_priority_service.log_dummy_write_set(
ws_handle, ws_meta);
ret = ret || high_priority_service.append_fragment_and_commit(
ws_handle, ws_meta, data);
if (ret)
{
high_priority_service.rollback();
}
high_priority_service.after_apply();
}
else if (wsrep::commits_transaction(ws_meta.flags()))
{
if (high_priority_service.is_replaying())
{
ret = high_priority_service.apply_write_set(data) ||
ret = high_priority_service.apply_write_set(ws_meta, data) ||
high_priority_service.commit(ws_handle, ws_meta);
}
else
@ -129,6 +135,7 @@ namespace
{
wsrep::high_priority_switch sw(
high_priority_service, *sa);
sa->remove_fragments(ws_meta);
ret = sa->commit(ws_handle, ws_meta);
sa->after_apply();
}

View File

@ -155,6 +155,12 @@ int wsrep::transaction::start_transaction(
return 0;
}
void wsrep::transaction::fragment_applied(wsrep::seqno seqno)
{
assert(active());
streaming_context_.applied(seqno);
}
int wsrep::transaction::prepare_for_ordering(
const wsrep::ws_handle& ws_handle,
const wsrep::ws_meta& ws_meta,
@ -271,10 +277,8 @@ int wsrep::transaction::before_prepare(
}
break;
case wsrep::client_state::m_high_priority:
if (is_streaming())
{
client_service_.remove_fragments();
}
// Note: fragment removal is done from applying
// context for high priority mode.
break;
default:
assert(0);
@ -909,8 +913,6 @@ int wsrep::transaction::certify_fragment(
ret = 1;
break;
}
wsrep::log_info() << "Committing "
<< sr_ws_meta.transaction_id().get();
if (storage_service.commit(ws_handle_, sr_ws_meta))
{
ret = 1;