mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-05 03:41:13 +03:00
Unnecessary adopt/start transaction in rollback_fragment()
This patch changes the handling of a rollback fragment so that the high_priority_service adopts and starts a new transaction only if fragment removal has to be performed. When no fragment removal happens, starting a new transaction is unnecessary: a dummy write set is logged instead and the transaction is not cleaned up properly in DBMS side.
This commit is contained in:
@ -216,11 +216,13 @@ static int rollback_fragment(wsrep::server_state& server_state,
|
||||
const wsrep::ws_meta& ws_meta)
|
||||
{
|
||||
int ret(0);
|
||||
// Adopts transaction state and starts a transaction for
|
||||
// high priority service
|
||||
int adopt_error;
|
||||
bool remove_fragments(false);
|
||||
if ((adopt_error = high_priority_service.adopt_transaction(
|
||||
int adopt_error(0);
|
||||
bool const remove_fragments(streaming_applier->transaction().
|
||||
streaming_context().fragments().size() > 0);
|
||||
// If fragment removal is needed, adopt transaction state
|
||||
// and start a transaction for it.
|
||||
if (remove_fragments &&
|
||||
(adopt_error = high_priority_service.adopt_transaction(
|
||||
streaming_applier->transaction())))
|
||||
{
|
||||
log_adopt_error(streaming_applier->transaction());
|
||||
@ -234,8 +236,6 @@ static int rollback_fragment(wsrep::server_state& server_state,
|
||||
high_priority_service, *streaming_applier);
|
||||
// Streaming applier rolls back out of order. Fragment
|
||||
// removal grabs commit order below.
|
||||
remove_fragments = streaming_applier->transaction().
|
||||
streaming_context().fragments().size() > 0;
|
||||
ret = streaming_applier->rollback(wsrep::ws_handle(), wsrep::ws_meta());
|
||||
ret = ret || (streaming_applier->after_apply(), 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user