diff --git a/include/wsrep/high_priority_service.hpp b/include/wsrep/high_priority_service.hpp index f1d011e..573f5e4 100644 --- a/include/wsrep/high_priority_service.hpp +++ b/include/wsrep/high_priority_service.hpp @@ -144,8 +144,14 @@ namespace wsrep * * @return Zero in case of success, non-zero in case of failure */ +#ifdef WITH_WSREP_SR_SPEEDUP + virtual int rollback(const wsrep::ws_handle& ws_handle, + const wsrep::ws_meta& ws_meta, + bool skip_rollback = false) = 0; +#else virtual int rollback(const wsrep::ws_handle& ws_handle, const wsrep::ws_meta& ws_meta) = 0; +#endif /* WITH_WSREP_SR_SPEEDUP */ /** * Apply a TOI operation. diff --git a/src/server_state.cpp b/src/server_state.cpp index 7efead0..57a6171 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -1577,6 +1577,9 @@ void wsrep::server_state::close_orphaned_sr_transactions( void wsrep::server_state::close_transactions_at_disconnect( wsrep::high_priority_service& high_priority_service) { +#ifdef DEBUG_SR_SPEEDUP + wsrep::log_info() << __FUNCTION__ << "(" << __LINE__ << ")"; +#endif /* DEBUG_SR_SPEEDUP */ // Close streaming applier without removing fragments // from fragment storage. When the server is started again, // it must be able to recover ongoing streaming transactions. @@ -1587,9 +1590,19 @@ void wsrep::server_state::close_transactions_at_disconnect( { wsrep::high_priority_switch sw(high_priority_service, *streaming_applier); - streaming_applier->rollback( - wsrep::ws_handle(), wsrep::ws_meta()); - streaming_applier->after_apply(); +#ifdef DEBUG_SR_SPEEDUP + wsrep::log_info() << __FUNCTION__ << "(" << __LINE__ + << ") skipped rollback for wsrep::trx = " + << streaming_applier->transaction().id(); +#endif /* DEBUG_SR_SPEEDUP */ +#ifdef WITH_WSREP_SR_SPEEDUP + streaming_applier->rollback( + wsrep::ws_handle(), wsrep::ws_meta(), true); +#else + streaming_applier->rollback( + wsrep::ws_handle(), wsrep::ws_meta()); +#endif /* WITH_WSREP_SR_SPEEDUP */ + streaming_applier->after_apply(); } streaming_appliers_.erase(i++); server_service_.release_high_priority_service(streaming_applier);