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

Fix crash close_orphaned_sr_transactions() BF abort

Some implementations of provider `bf_abort()` require `victim_ctx`
to point to application side victim context. However, when
total order BF abort was done from `close_orphaned_sr_transactions()`,
the application side context was not available.

To fix this, added an interface method `call_in_operation_context()`
which allows invoking a function object with a reference to
application side operation context passed in as a parameter.
This method is used in `close_orphaned_sr_transactions()`
to call `client_state::total_order_bf_abort()` with appropriate
victim operation context.
This commit is contained in:
Teemu Ollakka
2023-09-16 10:11:49 +03:00
parent bd1a5c25a9
commit a7ce22ac91
4 changed files with 38 additions and 1 deletions

View File

@ -28,10 +28,13 @@
#define WSREP_CLIENT_SERVICE_HPP
#include "buffer.hpp"
#include "operation_context.hpp"
#include "provider.hpp"
#include "mutex.hpp"
#include "lock.hpp"
#include <functional>
namespace wsrep
{
class client_service
@ -212,6 +215,15 @@ namespace wsrep
*/
virtual bool is_xa_rollback() = 0;
/**
* Perform a function call in operation context associated
* with the client service. The implementation must call @p fn
* with operation_context set appropriately.
*/
virtual void call_in_operation_context(
const std::function<void(wsrep::operation_context&)>& fn) const
= 0;
//
// Debug interface
//