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

Make is_rollbacker_active() public, don't unlock for background rollback

Make is_rollbacker_active() public so that the BF thread can
check if the rollbacker was started or not.

Also don't unlock the lock for launching the background
rollbacker to avoid race conditions in accessing the
victim state.
This commit is contained in:
Teemu Ollakka
2023-04-05 09:30:55 +03:00
parent 4951c38357
commit f8a20ff00f
2 changed files with 9 additions and 7 deletions

View File

@ -902,6 +902,15 @@ namespace wsrep
{
return current_error_status_;
}
/**
* Return true if rollbacker is active. The caller should
* hold the mutex protecting client_state.
*/
bool is_rollbacker_active()
{
return rollbacker_active_;
}
protected:
/**
* Client context constuctor. This is protected so that it
@ -1007,11 +1016,6 @@ namespace wsrep
{
rollbacker_active_ = value;
}
bool is_rollbacker_active()
{
return rollbacker_active_;
}
};
static inline const char* to_c_string(